All docs

Get started

Install Fettlecode

Start Fettlecode with Docker, create the administrator account with the setup code, and get it ready for other people.

Fettlecode is one container (the web app, its API, Git over HTTPS and SSH, and Pages) plus a PostgreSQL database. Everything it keeps lives in the database and one data folder.

Not released yet. The source code and image aren't public yet, so there's nothing to download today. These are the steps for the release.

What you need

  • Docker with Compose v2: Docker Desktop on Windows and macOS, or Docker Engine on Linux.
  • Disk space for your repositories and their large files.
  • For a team: a domain name, and a reverse proxy for HTTPS (Caddy, nginx or similar).

Start it

In the Fettlecode folder:

./install.sh

The install script checks Docker, writes a .env file with a random database password, starts Fettlecode and prints the setup code you'll need next. The first start builds the image, which takes a few minutes. Later starts take seconds.

Without the script (on Windows, say), docker compose up -d starts it too. For a team, ./install.sh --url https://code.example.org also sets the address, TRUST_PROXY and the SSH host.

Create the administrator account

Open http://localhost:3200. The first account you make becomes the instance admin, and making it needs the setup code. The server prints the code in its log while there are no accounts:

docker compose logs app

Look for the line that says No accounts yet and copy the code (it looks like K7QM-3XRP). Type it into the Setup code box on the sign-up form, with your name, username, email and a password. Capitals and the dash don't matter.

The code means only someone who can read the server's log can claim it, even if other people can reach the address first. To choose the code yourself (for a scripted install), set SETUP_CODE (8 characters or more) before starting.

After that, sign-up is closed. Other people join by invitation, through single sign-on, or, if you want an open instance, with ALLOW_SIGNUP=true.

On the first start Fettlecode makes a secret (AUTH_SECRET) for sessions and stored tokens, and keeps it in the data volume. Keep that volume and your backups safe: without the secret, stored tokens can't be read.

Get it ready for a team

Put the settings in a .env file next to compose.yaml, then run docker compose up -d again. A typical set:

APP_URL=https://code.example.com
POSTGRES_PASSWORD=a-long-random-password
TRUST_PROXY=true
SMTP_URL=smtps://user:[email protected]:465
MAIL_FROM=Fettlecode <[email protected]>
SSH_HOST=code.example.com

APP_URL is the address people use; links in emails and webhooks are built from it. Every setting is in Settings.

HTTPS

Serve Fettlecode through a reverse proxy that handles HTTPS. With Caddy, which gets a certificate for you:

code.example.com {
  reverse_proxy localhost:3200
}

Set TRUST_PROXY=true behind a proxy, so rate limits and the audit log see people's real addresses.

Git over SSH

SSH listens on port 2222. Clone addresses look like ssh://[email protected]:2222/owner/repo.git. SSH_PUBLISHED_PORT changes the port on the host, SSH_HOST the host shown in addresses, and SSH_PORT=0 turns SSH off. The host key is made on the first start and kept in the data volume.

Next