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 need | Notes |
|---|---|
| Deployer VM | Ubuntu 24.04, 2 GB RAM, static IP, ports 22, 80 and 443 open. |
| Services VM | Ubuntu 24.04, 4 GB RAM or more, static IP, ports 22, 80 and 443 open. You can add more later. |
| A domain | One you can add DNS records to. The examples use example.com. |
| An email address | For Let's Encrypt certificate notices. |
| Optional | A 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:
| Name | Type | Value | What it's for |
|---|---|---|---|
admin.example.com | A | Deployer VM's IP | The console |
*.example.com | A | Services VM's IP | Every 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_ROOTandAGENT_NAMESPACEchoose 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/avrosphereandavrosphere(names from the project Lanternly was extracted from).- If your app images are private on ghcr.io, also pass
GHCR_USERandGHCR_TOKEN(a token withread:packages).
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
- Open
https://admin.example.com/admin. The certificate is issued on the first visit, so give it a few seconds. - Enter the setup code, your name, email and a password (12 characters or more).
- Scan the QR code with an authenticator app and enter the 6-digit code. You land on Projects, the console's home page.
- On the deployer VM, remove the
DEPLOYER_SETUP_TOKENline from/opt/deployer/.envand restart:cd /opt/deployer && sudo docker compose up -d.
5. Connect the console to your server
- 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). - 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.
- Settings → GitHub → Connect GitHub if you'll deploy from repos. See Connect GitHub.
- 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:
| Kind | Name | Value |
|---|---|---|
| secret | DEPLOYER_VM_SSH_KEY | Private key that can SSH to the deployer VM |
| secret | DEPLOYER_SETUP_TOKEN | A code you make up (16+ letters and digits), typed once at the first sign-in |
| variable | DEPLOYER_VM_HOST | The deployer VM's address |
| variable | DEPLOYER_VM_USER | SSH user (default ubuntu) |
| variable | DEPLOYER_DOMAIN | admin.example.com |
| secret | SITES_VM_SSH_KEY | Private key that can SSH to the services VM |
| variable | SITES_VM_HOST, SITES_VM_USER | The services VM's address and SSH user |
| variable | ACME_EMAIL | Email for certificate notices |
| secret / variable | GHCR_READ_TOKEN / GHCR_USER | Optional: lets the services VM pull private ghcr.io images |
| variable | DEPLOYER_VM_HOST_KEY, SITES_VM_HOST_KEY | Optional. 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.