Install
Installing takes a few minutes: you paste one line into a terminal on your server and answer two questions. First check Requirements.
1. Open a terminal on the server
Section titled “1. Open a terminal on the server”Use the IP address and user name your provider gave you:
ssh root@YOUR_SERVER_IPReplace root with your own user name if the provider gave you another. The commands below start with sudo, which means “run this as the administrator”. If you are logged in as root, you can leave sudo out.
2. Paste the install line
Section titled “2. Paste the install line”Copy the whole line, paste it and press Enter:
sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/aftabIR/aftabWG/main/install.sh)"The installer asks two things:
- The licence. Read it and type
yes. If you do not, nothing is installed. - HTTPS, a padlock for the panel. Choose a domain that points to this server, this server’s IP address, or not now. With no domain, choose the IP address. HTTPS explains each choice.
If you will choose a domain or the IP address, open TCP port 80 in your provider’s firewall before you paste the line: Let’s Encrypt checks the server at the end of the install. With that port closed HTTPS is not set up, and the panel runs over plain HTTP until you add it (see HTTPS).
It then downloads the right version for your server, checks its signature, and keeps away from ports and subnets that are already in use, such as an existing WireGuard, OpenVPN or Docker. Nothing is compiled on your server.
3. Save what it prints
Section titled “3. Save what it prints”At the end the installer shows the panel address, with a random port and a secret path, and a random username and password. Save the password now: it is not shown again. If you lose it, sudo aftab reset-admin makes a new one, and sudo aftab info shows the address and username again.
The installer also made a default inbound and a client named default. First sign-in uses them.
Installing from a script
Section titled “Installing from a script”For automation, put variables before bash:
AFTAB_ACCEPT_EULA=1accepts the licence when nobody is typing.AFTAB_USERNAMEandAFTAB_PASSWORDset the sign-in.AFTAB_PORTandAFTAB_PATHset the panel’s port and secret path.AFTAB_WG_PORTsets the UDP port of the VPN.AFTAB_PUBLIC_HOSTsets the address put in client configs.AFTAB_BRANDsets the brand name.AFTAB_VERSIONinstalls a particular version.AFTAB_RESULTwrites the result to a file that only root can read.AFTAB_SSL=ip,AFTAB_SSL=domainorAFTAB_SSL=noneanswers the HTTPS question.AFTAB_DOMAINis the domain forAFTAB_SSL=domain, and the address put in client configs whenAFTAB_PUBLIC_HOSTis not set.- By default the installer also installs Tor, AmneziaWG, and the pinned components the panel may need (
wstunnel,hev-socks5-tunnel,amneziawg-go,psiphon-tunnel-corewhen this CPU has a build). SetAFTAB_SMALL=1to skip them; add them later withsudo aftab extras install. Offline installs that cannot reach GitHub should useAFTAB_SMALL=1, thenaftab component addoraftab extras installwhen a mirror is available.AFTAB_AWG=1is obsolete (full install already runs AmneziaWG).
Nobody can answer the HTTPS question in a script, so without a terminal the installer skips HTTPS and prints No terminal: HTTPS skipped, unless you give AFTAB_SSL or AFTAB_DOMAIN, or an AFTAB_PUBLIC_HOST that is a domain name. Add HTTPS later with sudo aftab ssl: see HTTPS.
A password given this way stays in your shell history and shows in the process list while the installer runs. Leave AFTAB_PASSWORD out and the installer makes a random one.
sudo AFTAB_ACCEPT_EULA=1 AFTAB_PORT=2053 AFTAB_PATH=/secret/ \ bash -c "$(curl -fsSL https://raw.githubusercontent.com/aftabIR/aftabWG/main/install.sh)"When the server cannot reach GitHub
Section titled “When the server cannot reach GitHub”On another computer, download these files from the project’s Releases page:
install.shaftab-X.Y.Z-linux-amd64.tar.gz, or the-arm64or-armv7file that matches the serverSHA256SUMSandSHA256SUMS.minisig
Put them in one folder on the server and run:
sudo AFTAB_SOURCE=/root/aftab-X.Y.Z-linux-amd64.tar.gz bash install.shOr set AFTAB_MIRROR to an https:// mirror of the download address.
What can go wrong
Section titled “What can go wrong”- “this kernel cannot create WireGuard interfaces”. The server is an OpenVZ or LXC container. Rent a KVM or Xen server with Linux 5.6 or newer.
- “unsupported distribution”. Use one of the systems in the table on the Requirements page.
- A line that ends “Fix: …, then run this installer again”. The panel runs as its own user, never as root, and this server cannot run it that way yet: it uses
iptables-legacy, the panel’s users orsetprivare missing, oraftab-panelcannot read a certificate the settings name. The installer stopped before it changed anything. Do what the line says afterFix:, then run the installer again. For a certificate it gives two ways: let the panel’s user read it, if it is this panel’s own certificate, or clear the setting. - The server is in Iran. The installer notices, recommends a server abroad with a bridge here, and stops if you answer
n. - “the panel failed to start”. Read the log with
sudo aftab log, or its last lines withjournalctl -u aftab -n 50.