Skip to content
ph1pPublic

About

Set up servers and deploy sites behind Traefik with automatic HTTPS

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

landfall

Deploy any folder to your own Linux server, with HTTPS, in two commands.

landfall (lf) is a CLI. It sets up a server over ssh and runs your sites on it as Docker Compose projects behind Traefik. Certificates are automatic. Nothing of landfall's runs on the server.

📖 Documentation: ph1p.github.io/landfall

landfall: a laptop terminal runs lf setup, lf deploy, lf domains and lf env over ssh; the server runs a firewall, Traefik with four sites, one of them also on a second server, and a journal of every change; browsers reach the sites over HTTPS

Quickstart

npm i -g landfall                        # installs both `landfall` and its short name `lf`
lf setup vps --host 203.0.113.7          # a fresh Ubuntu/Debian box gets Docker, a firewall, Traefik and your ssh key
cd my-site && lf deploy -s vps           # live at https://my-site.203-0-113-7.sslip.io

No DNS is needed for the first deploy. Add your own domain later with -d example.com.

No server yet? Try it locally runs the same commands against Docker containers on your machine.

Use cases

you want to landfall gives you
put a side project, a static site or an API online one VPS, one command per deploy, HTTPS without DNS setup
run many sites on one cheap server one Traefik for all of them, a domain per site, logs, env and backups per site
deploy from git and CI branch and tag rules per environment, lf promote test prod, a CI workflow from lf ci init
keep a database and its data safe named volumes, scheduled and offsite backups, restore in one command
keep a site up when one server fails one site on several servers, an edge server that balances and checks them
share a server with clients or teammates tenants: each gets its own rootless Docker, sites and domains, with limits
host at home, on a NAS or a Steam Deck works wherever Docker runs, even without a package manager
let an AI agent deploy and operate no prompts without a terminal, --json reads, clear exit codes, undo
see visitors without a third-party service cookieless analytics on your own server

How it works

  • A server is an ssh target. If ssh vps works, lf deploy -s vps works.
  • A site is a Compose project. docker compose up runs it on your laptop. lf deploy runs the same file behind HTTPS.
  • No agent on the server. Everything lives as plain files under /opt/landfall. You can fix it by hand.
  • Every change is journaled. lf history shows what landfall changed. lf undo reverts most of it.
  • Failed deploys roll back. A release whose containers do not start is replaced by the previous one.
  • One site, several servers, if you want. List them as servers in .landfall.json. lf deploy switches one server at a time, and lf sites info shows where they differ. See Several servers.
  • The CLI is the product. Scripts, CI jobs, AI agents and the web UI (lf ui) all run the same lf commands.

Made for AI agents

landfall is a good tool to hand to an AI coding agent such as Claude Code, Codex or Cursor. The agent can set up a server, deploy, read logs and fix problems on its own, and you can check every step.

  • No hidden prompts. Without a terminal, lf never waits for input. A command that would ask fails and says to pass -y.
  • Clean JSON. Read commands support --json. Results go to stdout, progress and errors to stderr.
  • Clear exit codes. 0 success, 1 error, 2 unknown command. lf check <site> exits 1 when the site is down.
  • Safe by default. -y never overrides a safety check, such as a firewall rule that would lock out ssh. Only --force does.
  • Secrets stay out of the command line. Passwords and env values come from stdin or environment variables, never from argv or the journal.
  • Every action is reviewable and undoable. lf history --json shows what a run changed. lf undo reverts it.
  • Docs for machines. llms.txt indexes the docs. Scripts, CI and AI agents is the full contract.

Give your agent this prompt to start:

Use the landfall CLI (`lf`) to deploy this project. Read https://ph1p.github.io/landfall/automation first.
Pass -y, use --json for reads, and run `lf check` after deploying.

Why landfall

  • Setting up a VPS by hand takes many steps. lf setup installs Docker, a firewall, Traefik and an ssh key in one command.
  • Certificates and DNS slow down the first deploy. A new site gets HTTPS on sslip.io right away.
  • Many deploy tools run a control plane on your server. landfall installs none. It leaves plain Compose projects behind.
  • Deploys should follow git. Rules say which branches and tags each environment takes. lf promote, lf ci init and lf autodeploy keep to them.
  • Day-to-day work is spread over many tools. Logs, env and secrets, domains, backups, updates, firewall and scans are all lf commands.

Install

npm i -g landfall            # or: pnpm add -g landfall
lf --help                    # all commands
lf <command> --help          # one command's options

Your machine needs Node.js 22.4+, ssh, ssh-copy-id and tar. rsync makes redeploys faster.

The server needs a root login, or a user with passwordless sudo. landfall installs Docker itself:

  • Ubuntu and Debian: Docker, ufw, unattended-upgrades, and fail2ban when ssh passwords stay on. No ufw behind an AWS, Google Cloud, Azure, Oracle or Alibaba firewall.
  • Fedora, RHEL-likes, Alpine, SUSE (dnf, yum, apk, zypper): Docker and rsync.
  • No package manager (Synology DSM, SteamOS): works when Docker is already there. See NAS, Steam Deck and other systems.

Your first deploy

lf setup vps --host 203.0.113.7          # once per server: Docker, firewall, Traefik, an ssh key
cd my-site
lf deploy -s vps                         # → https://my-site.203-0-113-7.sslip.io
lf deploy -s vps -d example.com          # or your own domain (point its A record at the server first)
lf deploy                                # later: redeploy; settings come from ./.landfall.json

lf deploy looks at the folder and picks what to do:

What lf deploy makes of a folder, first match wins: a compose.yaml runs as it is, --image pulls a prebuilt image, a Dockerfile is built on the server, an app (Node, Python, Go, Rust, PHP and more) gets a Dockerfile landfall writes, static files are served by nginx:alpine; each becomes one Compose project behind Traefik with HTTPS

Apps cover Node.js, Bun, Deno, Python, Go, Rust, Java/Kotlin, .NET, Ruby, PHP and Elixir. See Deploy a site and Compose sites.

Everyday commands

lf ls                              # sites with status
lf logs -f                         # follow a site's logs
lf env API_KEY=abc                 # set a variable (recreates the services)
lf domains --add www.example.com   # add a domain
lf rollback                        # go back to the previous release
lf deploy -E prod --tag latest     # deploy the newest tag the prod git rule allows
lf volume backup                   # back up the site's data
lf updates && lf update            # list, then apply OS and image updates
lf history && lf undo              # what landfall changed; revert the last run
lf ui                              # all of this in a local web UI

Concepts

How the pieces fit: on your machine, .landfall.json gives lf its defaults; lf reaches a server over ssh with one bash script per run; on the server, Traefik routes the main domain to sites, each site is one Compose project with its last 5 releases, a journal records every change for lf undo; optional: a group puts the same site on more servers, and tenants get TLS passthrough to their own rootless Docker
term meaning
server An ssh target: a ~/.ssh/config alias, or one added with lf server add or lf setup. Pass it as -s <name>. The first one added is the default.
site One Compose project on a server. It is your compose.yaml, or one landfall generates for a static folder, Dockerfile or image.
project file ./.landfall.json, written by the first lf deploy: { "name", "server", "domains" }.
main domain Optional, per server (lf server domain vps example.com). Sites then default to <site>.example.com. Without one, sites get <site>.<ip-with-dashes>.sslip.io.
release One per deploy. The last 5 stay (--keep n). lf rollback switches between them.
run One lf invocation that changed a server. lf history lists runs. lf undo reverts them.
group Opt-in. One site on several servers: "servers": ["a", "b"] in .landfall.json, or -s a,b. The first is the primary. Site commands run on each server; an edge server can balance between them. See Several servers.
tenant Opt-in. A user on your server with its own rootless Docker, sites and Traefik, limited to the domains you give it (lf tenant add). See Tenants.

The site comes from the argument, else from ./.landfall.json. The server comes from -s, else from ./.landfall.json, else the default server (lf server use).

Documentation

Everything is at ph1p.github.io/landfall.

guide covers
Try it locally Docker containers as test servers: setup, deploy, several servers, tenants
Servers lf setup, its flags, registering servers, NAS and other systems
Deploy a site site kinds, env and secrets, CI, uploads, environments, main domains
Git deploys branch and tag rules, --ref/--tag, promote, CI, auto-deploy
Compose sites x-landfall, routes, private ports, IP allowlists, volumes
Day-to-day logs, env, secrets, domains, logins, tunnels, restart, removal
Scaling and load balancing replicas, rolling deploys, traffic split
Lifecycle hooks commands or npm scripts around build, deploy, rollback and removal
Several servers groups, private networks, pinned services, an edge in front, drift and lf sync
Volumes and backups scheduled and offsite backups, push and pull data
Updates OS packages, images, Docker Compose, vulnerability scans
Traefik landfall's Traefik, HTTP/3, the dashboard, your own Traefik
Server administration firewall, services, SSH keys, users, swap, hardening
Tenants sharing a server: users with their own rootless Docker, sites and domains
Traffic, certificates and checks request stats, certificate state, HTTPS checks
Analytics visitors, funnels, events and web vitals on your own server, cookieless by default
History and undo the server journal, what lf undo reverts
Plugins exposure checks, fail2ban, Trivy, installing and writing plugins
Web UI lf ui, its pages, its security model
Scripts, CI and AI agents non-interactive use, --json, secrets, exit codes, recipes
Reference every command, file and environment variable
Troubleshooting error messages and fixes

Contributing

Working on landfall itself? Read CONTRIBUTING.md. Coding agents read AGENTS.md.

License

MIT

About

Set up servers and deploy sites behind Traefik with automatic HTTPS

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages