Self-host InsForge on a managed VPS: a backend for your coding agents

To self-host InsForge on a managed VPS is to give your coding agents a database, authentication, file storage and edge functions on a server of your own, which our teams keep up to date and monitor day and night. InsForge is an open source backend platform under the Apache-2.0 license, built to be driven by AI coding agents through its MCP server. This guide follows its official Docker Compose setup at version 2.3.5, and we ran every command on a Simafri VPS before writing it: installation, HTTPS, a first table and file through the API, backups, a restore into an empty database, and an update.

Simon Vasconcelos Lee By Published on 2 December 202612 minute read

All guides AI and automation

In short

  1. The Apache-2.0 license lets you run InsForge for your projects and your clients with no license to buy.
  2. Install it with the official deploy/setup.sh, pinned to a release with INSFORGE_REF: it checks out the files the stack reads and generates every secret into .env.
  3. Pin the image with a small pin.yml, publish the application on 127.0.0.1 with APP_PORT, set API_BASE_URL to your https:// address, and put Caddy in front.
  4. Back up the database with the PostgreSQL 15 pg_dump of the database image, in custom format, plus an archive of the storage volume and a copy of .env.
  5. To update, move the checkout to the new tag with the same script, change the tag in pin.yml, then pull and restart: the backend runs its migrations itself.

What InsForge does

InsForge is a backend platform designed for agentic coding: your coding agent reads the state of the backend, then configures it the way a backend engineer would. Self-hosted, it is driven through its MCP server, which any MCP-compatible agent can call, through its REST API and its SDKs, and through a web dashboard.

What the Apache-2.0 license allows

InsForge is published under the Apache License 2.0. You can use it free of charge, for your own projects or for your clients, copy it, modify it and distribute it, provided you keep the license and copyright notices and state the files you changed. The license also grants a patent license from its contributors. The software is provided without warranty.

Some features call third-party services that you pay for separately if you use them: the language models behind the Model Gateway, Vercel for site deployment, Fly.io for compute. The database, authentication, storage and edge functions run entirely on your server.

The resources to plan for

The stack has four containers: PostgreSQL, PostgREST, the InsForge backend, which also serves the dashboard, and the Deno runtime. Here is what we measured on our test VPS, with 2 vCPU and 4 GB of memory, after the installation and a first table, record and file:

Server size therefore depends on your data, your traffic and your edge functions. On a managed VPS, tell us about your usage and we will recommend the right size.

Installing with Docker Compose

Every service of the self-host stack runs a published image, so there is nothing to build. The compose file still reads a few files from the repository, such as the PostgreSQL configuration and the host of the edge functions, so InsForge ships a setup script that checks them out with Git and generates the secrets. On a server with Git, Docker Engine and its Compose plugin, installed from Docker’s repository for Ubuntu, download the script of the release you install, then run it with that release, so the checkout matches your image:

Terminal, as root
curl -fsSL https://raw.githubusercontent.com/InsForge/InsForge/v2.3.5/deploy/setup.sh -o insforge-setup.sh
INSFORGE_REF=v2.3.5 sh insforge-setup.sh /opt/insforge

The script clones a sparse checkout of the release into /opt/insforge, creates .env from .env.example with mode 600, and generates JWT_SECRET, ENCRYPTION_KEY, POSTGRES_PASSWORD, ROOT_ADMIN_PASSWORD and the two access keys, ACCESS_API_KEY and ACCESS_ANON_KEY. It starts nothing. The README pipes the script from the main branch into sh; downloading it first lets you read it, and the tag keeps it in step with the release.

Pinning the release and publishing locally

The compose file uses the latest tag of the InsForge image. On the day we tested, latest and v2.3.5 were the same image, but a full version lets you choose when each update happens. InsForge’s own rollback procedure does it with an overlay file named in COMPOSE_FILE; create it in /opt/insforge:

/opt/insforge/pin.yml
services:
  insforge:
    image: ghcr.io/insforge/insforge-oss:v2.3.5

Then set your public address, publish the application on 127.0.0.1 only, add pin.yml to COMPOSE_FILE, and start the stack:

Terminal, in /opt/insforge
sed -i -e "s|^API_BASE_URL=.*|API_BASE_URL=https://insforge.example.com|" -e "s|^VITE_API_BASE_URL=.*|VITE_API_BASE_URL=https://insforge.example.com|" -e "s|^APP_PORT=.*|APP_PORT=127.0.0.1:8116|" -e "s|^COMPOSE_FILE=.*|COMPOSE_FILE=deploy/docker-compose/docker-compose.yml:pin.yml|" .env
docker compose up -d
docker compose ps

On the first start, the backend runs its database migrations, then listens. On our test VPS, it answered a few seconds after its container started. To check that it is ready:

Terminal, in /opt/insforge
until curl -sf http://127.0.0.1:8116/api/health >/dev/null; do sleep 5; done
curl -s http://127.0.0.1:8116/api/health

The answer gives the status and the version: {"status":"ok","version":"2.3.5","service":"Insforge OSS Backend",...}.

HTTPS: the reverse proxy

The backend serves the dashboard and the API over HTTP, on port 8116 of the server. HTTPS is handled by a reverse proxy in front of it. We tested Caddy, installed from its official Debian and Ubuntu repository, which InsForge’s security guide also proposes: it obtains the Let’s Encrypt certificate itself, renews it, and passes the WebSocket connections of InsForge’s realtime features on its own.

/etc/caddy/Caddyfile
insforge.example.com {
	reverse_proxy 127.0.0.1:8116
}
Terminal
systemctl reload caddy
Terminal
curl -sI https://insforge.example.com/dashboard/login | head -1
curl -s https://insforge.example.com/dashboard/login | grep -o -E "<title>[^<]*</title>"

The first command returns HTTP/2 200, the second <title>InsForge Dashboard</title>. The root of the address redirects to /dashboard/login.

The first login and a first table

Open https://insforge.example.com: the dashboard asks for the administrator account. Its username is admin, set by ROOT_ADMIN_USERNAME, and its password was generated in .env:

Terminal, in /opt/insforge
grep ^ROOT_ADMIN_PASSWORD= .env

Once you are signed in, the README has you follow the steps of the dashboard to connect the InsForge MCP server to your coding agent. On our VPS, we signed in through the endpoint of the administrator login, /api/auth/admin/sessions: it returned an access token for the right password and a 401 for a wrong one.

A table and a record through the API

The ACCESS_API_KEY generated in .env is the administrator key of the API, sent in the x-api-key header. These commands create a notes table, write a record and read it back, which is a quick way to check the database, PostgREST and the backend together:

Terminal, in /opt/insforge
U=https://insforge.example.com
K=$(grep ^ACCESS_API_KEY= .env | cut -d= -f2)
curl -s -X POST $U/api/database/tables -H "x-api-key: $K" -H "Content-Type: application/json" -d '{"tableName":"notes","columns":[{"columnName":"title","type":"string","isNullable":false,"isUnique":false}]}'
curl -s -X POST $U/api/database/records/notes -H "x-api-key: $K" -H "Content-Type: application/json" -H "Prefer: return=representation" -d '[{"title":"Written before the backup"}]'
curl -s $U/api/database/records/notes -H "x-api-key: $K"

InsForge adds an id, created_at and updated_at to each table, and the last command returns the record with them. Keep this key on the server side, since it carries administrator rights. Your front end uses ACCESS_ANON_KEY and the tokens of signed-in users instead.

A bucket and a file

Terminal, in /opt/insforge
curl -s -X POST $U/api/storage/buckets -H "x-api-key: $K" -H "Content-Type: application/json" -d '{"bucketName":"files","isPublic":false}'
echo 'Uploaded before the backup' > /tmp/hello.txt
curl -s -X PUT $U/api/storage/buckets/files/objects/hello.txt -H "x-api-key: $K" -F file=@/tmp/hello.txt
curl -s $U/api/storage/buckets/files/objects/hello.txt -H "x-api-key: $K"

The last command returns the content of the file. On the server, it lives in /insforge-storage/files/hello.txt, inside the storage-data volume.

Backups

Everything lives in three places: the PostgreSQL database, the storage-data volume with your files, and your .env file. Keep the latter safe: ENCRYPTION_KEY is needed to read the secrets stored in the database.

The database image runs PostgreSQL 15.18, but the pg_dump, pg_restore and psql on its path are version 18. On our VPS, a dump made with them, including the one of deploy/backup.sh, started with SET transaction_timeout = 0, a setting PostgreSQL 15 does not know. A restore that stops at the first error, as a restore should, stopped on that line. The image also contains the PostgreSQL 15 tools, in /usr/lib/postgresql/15/bin: they write a dump that PostgreSQL 15 restores without an error.

The dump and the copies hold your data and your secrets, so create them readable by root only, with umask 077 inside parentheses: the rest of your session keeps its usual mask. The custom format of pg_dump is compressed and is restored with pg_restore; the InsForge image includes tar for the files:

Terminal, in /opt/insforge
(
  umask 077
  mkdir -p backups
  docker compose exec -T postgres /usr/lib/postgresql/15/bin/pg_dump -U postgres -Fc insforge > backups/insforge-$(date +%F).dump
  docker compose exec -T insforge tar -C /insforge-storage -czf - . > backups/storage-$(date +%F).tar.gz
  cp .env backups/env-$(date +%F).bak
)
ls -l backups

Schedule this copy and send it off the server. Stored on the disk, the files are also included in the server’s nightly backups. The dashboard also has a Backup & Restore page, with scheduled backups for self-hosted instances according to the documentation; those backups cover the database only, not the files of Storage.

Restoring

Stop the services that use the database, replace it with an empty one, remove the storage volume so that only the files of the archive come back, then load the dump and the files and start again. --exit-on-error stops the restore at the first error, and --single-transaction leaves nothing half restored:

Terminal, in /opt/insforge
docker compose stop insforge postgrest deno
docker compose exec -T postgres psql -U postgres -d postgres -c 'DROP DATABASE insforge WITH (FORCE)' -c 'CREATE DATABASE insforge'
docker compose rm -f insforge
docker volume rm insforge_storage-data
docker compose exec -T postgres /usr/lib/postgresql/15/bin/pg_restore -U postgres -d insforge --exit-on-error --single-transaction < backups/insforge-2026-11-20.dump
docker compose run --rm --no-deps -T --entrypoint tar insforge -C /insforge-storage -xzf - < backups/storage-2026-11-20.tar.gz
docker compose up -d

We tested the whole cycle on our VPS: the dump and the archive, a second record written after them, the database dropped and recreated empty, the storage volume removed, then the restore. The backend found its migrations already applied, the record written before the backup came back, the one written after it was gone, the file was back with its owner, and the administrator signed in again. On a new server, run the setup script and copy your .env and pin.yml first, then docker compose up -d postgres and the same commands.

Updates

InsForge publishes a release every few weeks on GitHub, with an image of the same number on its registry. The compose file and the PostgreSQL configuration come from the checkout, so an update moves the checkout as well as the image. Take a backup, note the running version, fetch the new tag and look at what changed in the files the stack reads, including .env.example, whose new variables you copy into your .env by hand:

Terminal, in /opt/insforge
docker compose images insforge
git fetch --depth 1 origin tag v2.3.5
git diff --stat HEAD v2.3.5 -- deploy functions .env.example

Then move the checkout with the same setup script, which keeps your .env as it is, change the tag in pin.yml, and pull and recreate the containers:

Terminal, in /opt/insforge
INSFORGE_REF=v2.3.5 sh deploy/setup.sh .
sed -i 's|insforge-oss:v2.3.4|insforge-oss:v2.3.5|' pin.yml
docker compose pull
docker compose up -d
curl -s http://127.0.0.1:8116/api/health

Who does what on a managed VPS

Self-hosting means running the server on top of the application. On a managed VPS, our teams take charge of the server and proactively monitor your instance; InsForge remains your backend, with your data, your keys and your settings.

TopicOur teamsYou
The serverSystem and security updates, server interventions includedThe timing that suits you
MonitoringServer monitored 24/7, with intervention without waiting for your callYour tables, your users, your functions and your settings in InsForge
InsForgeProactive monitoring: errors, slowdowns, database and disk space spotted, fix recommendedIts installation, updates, keys and settings, which you apply, yourself or through your AI assistant
Agents and keysThe server that carries them, monitored and backed upYour MCP connections, API keys and provider accounts
BackupsEvery night, encrypted and kept off the machine; restores includedInsForge’s own database dumps and storage archives, and the restore request, when you need one
MigrationYour current server migrated, free of chargeThe timing of the switch

If you would rather have our teams work inside the application itself, that service is billed by the hour or at a fixed rate, with an estimate shared before the work starts.

InsForge, on a server run for you

With a Simafri Managed VPS, our teams keep your InsForge instance’s server up to date, monitor it day and night and step in without waiting for your call; they also proactively monitor your instance and recommend useful fixes, which you apply, yourself or through your AI assistant. Backups are encrypted every night and kept off the machine, restores are included, and migrating your current server is free.

Explore Managed VPS

Frequently asked questions

Is InsForge free to self-host?

Yes. InsForge is under the Apache-2.0 license: you can run it for your projects or your clients with no license to buy. What remains is the cost of the server, and of the third-party services you choose to connect, such as language model providers.

How do I self-host InsForge with Docker Compose?

Download deploy/setup.sh from the release you want and run it with INSFORGE_REF set to that release: it checks out the files the stack reads and generates the secrets in .env. Pin the image in a pin.yml added to COMPOSE_FILE, set API_BASE_URL and VITE_API_BASE_URL to your https address, publish APP_PORT on 127.0.0.1, run docker compose up -d, and put an HTTPS reverse proxy in front.

What is the default InsForge admin login?

The username is admin, from ROOT_ADMIN_USERNAME. The setup script generates a random ROOT_ADMIN_PASSWORD in .env; without the script, the compose file falls back to a published default password, so always set your own before the first start.

Does self-hosted InsForge need S3?

No. With S3_BUCKET left empty, files are stored on the local disk, in a Docker volume. An S3-compatible store is optional: the README offers bundled MinIO or RustFS overlays, or your own provider, which also enables InsForge’s S3-compatible gateway.

How much memory does InsForge need?

On our test VPS, the four containers used about 250 MB at rest: about 116 MB for the backend, 73 MB for PostgreSQL, 48 MB for Deno and 14 MB for PostgREST. The images take about 1.3 GB of disk.

How do I back up self-hosted InsForge?

Dump the database in custom format with /usr/lib/postgresql/15/bin/pg_dump from the postgres container, archive /insforge-storage from the insforge container, and keep a copy of .env. Restore with the matching pg_restore and --exit-on-error into an empty database, then extract the archive, the backend stopped.

How do I update self-hosted InsForge?

Take a backup, run deploy/setup.sh again with INSFORGE_REF set to the new release, change the tag in pin.yml, then run docker compose pull and docker compose up -d. The backend applies its database migrations when it starts.

Does a managed VPS cover InsForge?

A managed VPS covers the server: system, security, monitoring and backups. Our teams also proactively monitor your instance and recommend useful fixes, which you apply. Work inside the application is billed by the hour or at a fixed rate.

Contact us