Deploy

Deploy with Docker

One command to install on your server.

The lokipay-admin repository contains the server, the dashboard, the hosted pages and a deploy script. One command syncs the code to the server, builds the Docker image, configures nginx with HTTPS and schedules nightly backups.

Describe the deployment
deploy.env (git-ignored — keep one file per client)
REMOTE_HOST=203.0.113.10        # server IP or hostname (SSH as root by default)
DOMAIN=pay.yourshop.com         # DNS A record → REMOTE_HOST
SSL_EMAIL=ops@yourshop.com      # Let's Encrypt account email
# REMOTE_USER=root
# REMOTE_DIR=/var/www/lokipay
# API_HOST_PORT=5310
# POSTGRES_HOST_PORT=5534

For several clients, keep files like clients/acme.env and run DEPLOY_ENV=clients/acme.env ./deploy.sh.

Run the deploy script
bash
./deploy.sh

On the first run the script stops and asks you to create /var/www/lokipay/.env on the server. Copy .env.example, fill in the secrets (see environment variables), and run ./deploy.sh again.

What the script does
  1. Rsyncs the source to /var/www/lokipay (never your local .env).
  2. docker compose up -d --build: builds the dashboard and pay pages into the API image, starts Postgres 16 and the API, runs database migrations and creates the first admin.
  3. Waits for /health/ready.
  4. Writes an nginx site with rate limits for the device and login endpoints, gets a Let’s Encrypt certificate and reloads nginx on renewal.
  5. Installs a nightly pg_dump backup with 14-day retention.
Sign in

Open https://pay.yourshop.com and sign in with ADMIN_EMAIL / ADMIN_PASSWORD. Change the password in Settings → Security.

Containers#

ContainerImagePort (loopback)
lokipay-apinode:22-alpine — API, dashboard, pay pages127.0.0.1:5310 → 3000
lokipay-postgrespostgres:16-alpine127.0.0.1:5534 → 5432

Volumes: lokipay-postgres-data (database) and lokipay-uploads (relay app APKs and your logo).

Useful commands

on the server
cd /var/www/lokipay
docker compose ps
docker compose logs -f api          # API logs
docker compose restart api
docker exec -it lokipay-postgres psql -U lokipay lokipay