Supaffi

Self-hosting/Install

Install

One command installs Supaffi on a Linux server.

Before you install

  • A Linux server with a public IPv4 address, git and openssl. The full list is in Requirements.
  • Docker 24 or newer. If Docker is missing, the installer asks before installing it with Docker's official script.
  • Port 3443 allowed in your hosting provider's firewall, and ports 80 and 443 for your affiliate portals.

You need no domain and no DNS record to install. The owner dashboard is served on the server's own address. Each product's affiliate subdomain is added later, from the dashboard.

Run the installer

On the server, run:

Terminal
curl -fsSL https://raw.githubusercontent.com/ugolbck/supaffi/main/install.sh | sudo bash

It asks nothing in a normal run. In a few minutes it:

  • Clones the newest release into /opt/supaffi. It always installs an exact released version, never a branch.
  • Writes /opt/supaffi/.env, readable by root only, and generates the database password, the session secret and the MASTER_ENCRYPTION_KEY that encrypts your Stripe keys. Later runs never regenerate them.
  • Picks the proxy mode. If ports 80 and 443 are free, Supaffi brings its own proxy and handles HTTPS. If either is in use, it prints Port 80 or 443 is already in use, so Supaffi will not bring its own proxy. and leaves them to your proxy. See Reverse proxy and HTTPS.
  • Pulls the images, starts the stack and waits for the setup token.

When it finishes, it prints an address and a setup token:

Installer output
  Supaffi 0.4.0.

  Open https://203.0.113.10:3443/setup and paste this token:

      kX2mQ9vT4rLw8NcY3pHs

  Your browser will warn about the certificate. Continue past it. The
  warning means it cannot verify who this server is, which you already
  know. The connection is encrypted.

  If that address does not load, your hosting provider is blocking port
  3443. Allow it in their firewall, not on the server.

The installer only asks a question when it has to: to install a missing Docker, or for the server's public IP when it cannot detect it. Without a terminal, for example in a provisioning script, set SUPAFFI_INSTALL_DOCKER=yes and SUPAFFI_HOST_IP instead.

Create the owner account

  1. Open the address

    Open the /setup address the installer printed, for example https://203.0.113.10:3443/setup.

  2. Continue past the certificate warning

    The dashboard uses a certificate your server signs itself, so the browser cannot verify who the server is. You already know, and the connection is encrypted. To skip the warning for good, give the dashboard a domain with SUPAFFI_DOMAIN.

  3. Paste the setup token

    Paste it into Setup token. The token works until an owner exists, and a restart issues a new one. If you lost it, the last one in the log is valid:

    Terminal
    cd /opt/supaffi && docker compose logs app | grep "setup token"
  4. Create your login

    Enter your Email and a Password of at least 12 characters, then press Create account. You are signed in and taken to add your first product.

An instance has one owner. Once the owner exists, /setup closes and no token is issued again. Log in at /login on the same address.

Installer options

Options are environment variables. Put them on bash, not on curl, or they only reach the download:

Terminal
curl -fsSL https://raw.githubusercontent.com/ugolbck/supaffi/main/install.sh | sudo SUPAFFI_DOMAIN=supaffi.yourserver.com bash
VariableEffect
SUPAFFI_DOMAIN=supaffi.yourserver.comServes the owner dashboard on a domain. Optional, the address keeps working.
SUPAFFI_UPDATE_CHECK=offStops the dashboard checking GitHub for new releases.
SUPAFFI_BUILD_FROM_SOURCE=yesBuilds the image on the server instead of pulling it. Needs about 2 GB of RAM.
SUPAFFI_VERSION=x.y.zInstalls that exact version.

Every variable, with defaults, is in Configuration. To change one later, run the installer again with it. Your data and secrets are kept.

Next steps