Installing
14 answers
Getting the software onto a server and running for the first time.
Looking for something specific
The searchable index covers all 326 answers at once and filters as you type.
1 What do I actually need before I start?
One or two servers running Ubuntu 22.04 or newer, with internet access and root. That is the whole list.
- One server works and gives you the GUI, the certificates and the WAF.
- Two servers is what gives you failover, and is the shape everything here is designed around.
- The servers do not need to be large. Four processors and four gigabytes is comfortable for most workloads.
- You also want a domain name you control, so you can get certificates.
2 Install Failover LB on a fresh server
Two commands. The first fetches the code and sets up Docker if it is missing. The second builds nginx.
sudo git clone https://git.failoverlb.net/failoverlb.git /data/docker/failoverlb \
&& sudo /data/docker/failoverlb/failoverlb_setup.sh \
--allowlist 198.51.100.25/32 --acme-email you@example.com
sudo /data/docker/failoverlb/nginx-installer.sh install
Replace the allowlist with the public address of your office or wherever you will manage this from. Then open the address the installer printed on port 7443.
3 Which Ubuntu versions are supported?
22.04 and newer. The Docker setup script refuses anything older and says so. The installers are tested on the long term support releases, and they will try on other Ubuntu versions and tell you up front that they are outside what is promised.
Debian will very likely work and is not what this is written for.
Red Hat, Rocky and Alma are not supported, and the reasoning is written out on the why page. The short version is one person cannot honestly test four moving targets, plus a long standing grudge about CentOS.
4 What is the allowlist and what should I put in it?
It is the list of networks allowed to load the management GUI, and it is checked before the login page even renders. A stolen password from the wrong network gets nothing.
Put your office public address followed by /32, or your office range such as 198.51.100.0/24. If you are not sure what your address is, visit any site that reports it.
Without it, anybody who can reach port 7443 gets the login page. Set it before you put this anywhere interesting.
5 Find the first admin password
It is printed to the container log once, during installation.
cd /data/docker/failoverlb
sudo docker compose logs | grep -A3 "Made the first admin"
Change it as soon as you are in. If you have lost it entirely, use the console recovery command instead.
6 Run the installer again after something went wrong
It is safe. Fix whatever it complained about and run exactly the same command a second time. It leaves alone anything it has already done, and it never touches your .env file or your database.
7 Which ports have to be open?
| Port | Transport | For | Open to |
|---|---|---|---|
| 80 | TCP | Web traffic and certificate checks | Everyone |
| 443 | TCP, and UDP for HTTP/3 | Secure web traffic | Everyone |
| 7443 | TCP | The management GUI | Your office networks only |
| 7444 | TCP | Node to node | The other nodes only |
| 53 | UDP, and TCP for large answers | DNS failover answers | Everyone, if you use it |
| 51820 | UDP | The tunnel, if you use it | Your tunneled workloads, outbound to here |
Port 5353 is where the DNS part really listens, on UDP and TCP, and a firewall rule the software manages sends 53 to it. You never open 5353 and you never test against it.
8 Install without letting the script touch Docker
Pass --skip-docker if Docker is already set up the way you want it.
sudo /data/docker/failoverlb/failoverlb_setup.sh --skip-docker
9 Install from a copy of the code rather than from git
You do not need git access at all. Copy the folder onto the box, change into it, and run the setup script from inside it. It will use what is already there.
cd /path/to/failoverlb
sudo ./failoverlb_setup.sh
10 Clone from a private git repository
Pass credentials to the setup script, or set NFM_GIT_TOKEN in the environment.
sudo ./failoverlb_setup.sh --git-user myname --git-token ghp_xxx
The token is kept inside the function that builds the clone URL, so it does not end up in a log line or in the process list of anything except git.
11 Give a node a name and a fixed address
The installer guesses both, and the guess is worth checking on a box with several interfaces.
sudo ./failoverlb_setup.sh \
--name lb-01 --address 203.0.113.10 --priority 100
The address is the one other nodes will reach this one on. Priority decides who wins the election, and higher takes it.
12 Understand what the installer actually did
- Made a group called
nginxmgrwith gid 10001. - Installed the host agent to
/opt/nginx-fleet-managerand started it as a systemd service. - Wrote an
.envfile with this node's identity and its secret key. - Built and started the manager container.
- Turned off the certbot timer, on purpose.
- Put
nginx-installer.shat/opt/nginx-installer.shso rebuilds work from the GUI.
13 Install nginx after the manager is already running
The manager manages an nginx, it does not bring its own. The GUI comes up either way, and it warns you that nothing can be applied until nginx is there.
sudo /data/docker/failoverlb/nginx-installer.sh install
It takes the longest of any step because it compiles nginx from source with every module the GUI knows how to configure.
14 Where does everything live on disk?
| Path | What it is |
|---|---|
/data/docker/failoverlb | The software and the .env settings file |
/opt/nginx-fleet-manager | The host agent |
/etc/nginx | nginx configuration |
/etc/nginx/nginxmgr | The parts this software generates |
/etc/nginx/nginxmgr/certs | Certificates and keys |
/var/backups/nginx-fleet-manager | The config before each apply |
/run/nginxmgr/agent.sock | How the GUI talks to the agent |
Do not edit anything under /etc/nginx/nginxmgr by hand. It is rewritten from scratch on every apply.