Skip to main content
This is the recommended production path for Nudgra OSS. You host the app and Postgres on a VPS, then route HTTPS traffic through Caddy.

Prerequisites

Before you start, prepare:
  • A VPS running Ubuntu or Debian.
  • A domain or subdomain.
  • DNS access for the domain.
  • Google OAuth credentials.
  • Meta app credentials and a webhook verify token.

Point DNS to the VPS

Create an A record for the domain or subdomain.
If you use Cloudflare, use DNS only for the first certificate setup. After HTTPS works, you can enable the proxy if SSL/TLS mode is Full strict.

Install server packages

On Ubuntu or Debian:
Install Caddy with your preferred package method. If Caddy already serves other apps on the server, keep it running and add a new site block for Nudgra. Open the firewall:

Clone the app

Configure production .env

Edit:
Set:
Keep a private copy of .env. It contains the auth and token-encryption secrets needed to decrypt stored OAuth and Instagram tokens.
For production, also change the Postgres password in docker-compose.yml and update DATABASE_URL inside app.environment to match. Recommended: bind the app port to localhost only:

Start the app

The app container runs database migrations before startup. Check the local health endpoint:

Configure Caddy

Edit:
Add a site block:
If your Caddy server is already bound to a specific public IP for other apps, add bind:
Validate and reload:
Check HTTPS:
You want a 200 response.

Update a deployment

Back up Postgres

Create a compressed backup:
Restore into an empty database:
Back up .env separately.