LanternlyDocs

Get started

Install on your servers

A production install is two Ubuntu VMs: a small one that runs the console, and one or more that run your services. Plan on 15 to 30 minutes.

Before you start

You needNotes
Deployer VMUbuntu 24.04, 2 GB RAM, static IP, ports 22, 80 and 443 open.
Services VMUbuntu 24.04, 4 GB RAM or more, static IP, ports 22, 80 and 443 open. You can add more later.
A domainOne you can add DNS records to. The examples use example.com.
An email addressFor Let's Encrypt certificate notices.
OptionalA GitHub account (apps from repos), an S3-compatible bucket (backups), an SMTP account (alerts and invites by email).

Any provider works: AWS (EC2 or Lightsail), Google Cloud, Hetzner, Vultr, DigitalOcean or your own hardware. If you use AWS, the AWS plugin can create later services VMs for you.

1. Point your DNS

Add two records at your DNS provider:

NameTypeValueWhat it's for
admin.example.comADeployer VM's IPThe console
*.example.comAServices VM's IPEvery service's address, such as shop.example.com

The wildcard means new services get an address without a DNS change. You can use any subdomain for the console; admin. is only an example.

2. Set up the deployer VM

Copy the deploy/ folder from the repo to the VM and run the setup script as root:

scp -r deploy ubuntu@admin.example.com:
ssh ubuntu@admin.example.com
cd deploy
sudo DEPLOYER_DOMAIN=admin.example.com ./setup-deployer-vm.sh

It installs Docker, creates the console's SSH key and secrets in /opt/deployer (never printed again), writes Caddy's config, and prints three things. Keep them for the next steps:

  • the deployer's SSH public key (for the services VM),
  • this VM's host key,
  • a one-time setup code for the first sign-in. To choose your own, pass DEPLOYER_SETUP_TOKEN (16+ letters and digits) to the script.

Then start the console. Either build it on the VM:

git clone https://github.com/thiyagarajanshankar13/lanternly.git
cd lanternly && sudo docker build -t deployer .
cd /opt/deployer && sudo env DEPLOYER_IMAGE=deployer docker compose up -d

or let GitHub Actions build and deliver it (see Deploy from GitHub Actions below).

3. Set up a services VM

Copy the agent/ folder to the services VM and run its setup with the public key from step 2:

scp -r agent ubuntu@<services-vm>:
ssh ubuntu@<services-vm>
cd agent
sudo DEPLOYER_PUBLIC_KEY="ssh-ed25519 AAAA… deployer" \
     ACME_EMAIL=you@example.com \
     AGENT_ROOT=/opt/lanternly AGENT_NAMESPACE=lanternly \
     ./setup-clubs-vm.sh

It installs Docker, adds swap, starts Caddy and the clubctl tool, and creates a deployer user whose SSH key can run clubctl and nothing else. At the end it prints this VM's host key.

  • AGENT_ROOT and AGENT_NAMESPACE choose the folder and the container name prefix. They can't be changed once the server has services. If you leave them out, the defaults are /opt/avrosphere and avrosphere (names from the project Lanternly was extracted from).
  • If your app images are private on ghcr.io, also pass GHCR_USER and GHCR_TOKEN (a token with read:packages).
Close SSH to everyone else

Once it works, limit port 22 on the services VM to the deployer VM's IP in your provider's firewall. The console is the only thing that needs to reach it.

4. Sign in for the first time

  1. Open https://admin.example.com/admin. The certificate is issued on the first visit, so give it a few seconds.
  2. Enter the setup code, your name, email and a password (12 characters or more).
  3. Scan the QR code with an authenticator app and enter the 6-digit code. You land on Projects, the console's home page.
  4. On the deployer VM, remove the DEPLOYER_SETUP_TOKEN line from /opt/deployer/.env and restart: cd /opt/deployer && sudo docker compose up -d.

5. Connect the console to your server

  1. Settings → Edit settings: set Domain services live under to example.com. Fill in Outgoing email now if you have an SMTP account (needed for alerts and emailed invites).
  2. Servers → Add existing server: the services VM's address for SSH, its public IP, the host key printed by its setup, and its RAM. See Servers.
  3. Settings → GitHub → Connect GitHub if you'll deploy from repos. See Connect GitHub.
  4. Backups: add your bucket. See Backups.

Now create a project and your first service: Projects → New project → New service.

Deploy from GitHub Actions

The repo includes workflows that do the server work for you. Fork or copy the repo into your own GitHub account first.

Set up a VM

.github/workflows/setup-vm.yml runs steps 2 and 3 over SSH from GitHub Actions. Add these under your repo's Settings → Secrets and variables → Actions, then run it from Actions → Set up a VM:

KindNameValue
secretDEPLOYER_VM_SSH_KEYPrivate key that can SSH to the deployer VM
secretDEPLOYER_SETUP_TOKENA code you make up (16+ letters and digits), typed once at the first sign-in
variableDEPLOYER_VM_HOSTThe deployer VM's address
variableDEPLOYER_VM_USERSSH user (default ubuntu)
variableDEPLOYER_DOMAINadmin.example.com
secretSITES_VM_SSH_KEYPrivate key that can SSH to the services VM
variableSITES_VM_HOST, SITES_VM_USERThe services VM's address and SSH user
variableACME_EMAILEmail for certificate notices
secret / variableGHCR_READ_TOKEN / GHCR_USEROptional: lets the services VM pull private ghcr.io images
variableDEPLOYER_VM_HOST_KEY, SITES_VM_HOST_KEYOptional. On a first run the key the VM presents is accepted and shown in the run summary; save it here to enforce it from then on.

It's safe to run again: it also updates clubctl on the services VM after a change to agent/.

Deploy the deployer

.github/workflows/deploy-deployer.yml builds the console image on every push to main and delivers it to the deployer VM. It needs the secret DEPLOYER_VM_SSH_KEY and the variable DEPLOYER_VM_HOST.

Edit this page on GitHub