Skip to main content

Self-Host InsForge on Hetzner Cloud

This guide walks through self-hosting the InsForge platform on a Hetzner Cloud server using Docker Compose.
This deploys InsForge itself, not the app you built. If you just want to take your app live, use Sites instead. This guide is for running the InsForge backend on your own infrastructure.
This cloud walkthrough is community-maintained and can lag the latest InsForge release. The canonical, always-current setup is the deploy/docker-compose/ directory in the InsForge repo.

πŸ“‹ Prerequisites

  • A Hetzner Cloud account and project
  • An SSH key added to your Hetzner account before you create the server (Hetzner docs)
  • Basic familiarity with SSH and the command line
  • A domain name (optional, but recommended for HTTPS in production)

πŸš€ Deployment Steps

1. Create a Hetzner Cloud Server

  1. Open the Hetzner Console, select your project, and go to Servers β†’ Add Server.
  2. Configure the server:
  1. Optional add-ons:
    • Backups β€” daily automatic disk snapshots with seven rotating slots (Hetzner docs)
    • Firewall β€” you can attach one now or create it in the next step
  2. Click Create & Buy now.
πŸ’‘ Plan note: Hetzner also offers ARM-based CAX servers. InsForge publishes multi-arch images, but this guide assumes CX (x86) unless you have verified every container image pulls on your plan.
πŸ’‘ Pricing note: Server prices depend on location and plan. A Primary IPv4 address is billed separately (€0.50/month excluding VAT). See Hetzner Cloud pricing for current rates.

2. Configure a Hetzner Cloud Firewall

Hetzner Cloud Firewalls are free and filter traffic before it reaches your server (overview).
  1. In the console, go to Firewalls β†’ Create Firewall.
  2. Add inbound rules:
  1. Attach the firewall to your server under Apply to.
  2. Click Create Firewall.
⚠️ Do not open ports 5432, 5430, or 7133. In the self-host compose file, PostgreSQL, PostgREST, and Deno bind to 127.0.0.1 on the host and are not meant to be reached from the internet. For production, put Nginx or Caddy in front of InsForge on port 443 and stop exposing 7130 publicly β€” see Configure Domain below and the deployment security guide.

3. Connect to Your Server

Hetzner servers use root as the default SSH user (connecting docs):
Copy the IPv4 address from the server overview in the Hetzner Console.

4. Install Dependencies

4.1 Update System Packages

4.2 Install Docker

Follow Docker’s official Ubuntu install guide:
Install the Docker Engine and the Compose plugin (docker-compose-plugin). Verify:

4.3 Install Git

Git is required for the update path after the initial install:
πŸ’‘ Shortcut: Hetzner offers a Docker CE app that preinstalls Docker and the Compose plugin on Ubuntu 24.04. You can select it instead of a plain Ubuntu image if you prefer; the rest of this guide is the same.

5. Deploy InsForge

5.1 Fetch the Self-Host Files

This sparse-checkouts the files the stack reads and writes JWT_SECRET, ENCRYPTION_KEY, ROOT_ADMIN_PASSWORD, POSTGRES_PASSWORD, and the API keys into ~/insforge/.env (mode 600). Nothing is started yet.
Rather not pipe a script into a shell? Read it first:

5.2 Configure Environment

The secrets are already generated β€” leave them as they are. Set the URL browsers will use:
Optional integrations (all off by default):
See .env.example for every supported variable.
πŸ’‘ Back up .env somewhere safe. You need those secrets to migrate or restore this instance.

5.3 Start Services

Press Ctrl+C to exit the log view.

5.4 Verify Services

You should see four services β€” postgres, postgrest, insforge, and deno. Postgres and Deno report healthy when their health checks pass; PostgREST has no health check in this compose file and shows running.

6. Access Your InsForge Instance

6.1 Test the API

You should get JSON with "status": "ok" and "service": "Insforge OSS Backend".

6.2 Open the Dashboard

In your browser:
Log in with ROOT_ADMIN_USERNAME and ROOT_ADMIN_PASSWORD from .env.

7.1 DNS

Point a DNS A record at your server’s IPv4 address:
If you use a Floating IP instead of the server’s Primary IP, point DNS at the floating address so you can move it between servers later.

7.2 Reverse Proxy and TLS

Install Nginx:
Create a site config:
Enable it:
Obtain a certificate with Certbot:
Update .env with your HTTPS URL:
Restart InsForge:
Remove the firewall rule for port 7130 once HTTPS works, so traffic only enters on 443. For Caddy, UFW, SSH hardening, and more detail, see the deployment security guide.

πŸ”§ Management & Maintenance

View Logs

Stop or Restart

Update InsForge

The stack reads Postgres configuration and Deno function sources from this checkout, so updates are more than an image pull:

Backup Database

Restore:
Hetzner Backups (if enabled) snapshot the whole disk. They complement β€” but do not replace β€” logical pg_dump backups.

Monitor Resources

πŸ› Troubleshooting

Services Will Not Start

Cannot Reach the Dashboard

  • Confirm the Hetzner Firewall allows the port you are using (7130 or 443).
  • Check API_BASE_URL and VITE_API_BASE_URL match how you open the site in your browser.
  • Run curl http://localhost:7130/api/health on the server. If that works but the public URL does not, the issue is firewall or DNS β€” not InsForge.

Out of Memory

Resize to a larger plan in the Hetzner Console (Rescale), for example from CX23 to CX33.

πŸ”’ Security Best Practices

  1. Restrict SSH (port 22) to your IP in the Hetzner Firewall.
  2. Use HTTPS in production and stop exposing port 7130 publicly once a reverse proxy is in place.
  3. Keep .env at mode 600 and back it up securely.
  4. Run apt upgrade regularly and pull new InsForge images when you update.
  5. See the deployment security guide for UFW, SSH hardening, and automated backups.

πŸ†˜ Support & Resources

πŸ“ Cost Notes

Hetzner bills each server hourly with a monthly price cap. Prices vary by plan and location. In addition to the server:
  • Primary IPv4 β€” €0.50/month excluding VAT per address
  • Backups β€” optional add-on at checkout
  • Outgoing traffic β€” EU Cost-Optimized plans include 20 TB/month; only outbound traffic counts toward the quota
Check hetzner.com/cloud for current plan prices before you deploy.
Congratulations! Your InsForge instance is running on Hetzner Cloud. For hardening, backups, and rollback procedures, see the deployment security guide.