Self-host HeyForm on a managed VPS: your forms and surveys

To self-host HeyForm on a managed VPS is to keep your forms, surveys and every answer they collect on a server of your own, which our teams keep up to date and monitor day and night. HeyForm is a free, open source builder of conversational forms under the AGPL-3.0 license, designed for small businesses. This guide follows its official Docker image at version 3.0.7, and we ran every command on a Simafri VPS before writing it: installation with Docker Compose, MongoDB and KeyDB, HTTPS, the first account, a published form and its answers, backups and updates.

Simon Vasconcelos Lee By Published on 4 December 202612 minute read

All guides CRM, ERP and finance

In short

  1. The AGPL-3.0 license lets you run HeyForm for your company or your association with no license to buy; if you modify it and offer it to others, you publish your changes.
  2. Install it with Docker Compose: the image heyform/community-edition:v3.0.7, Percona Server for MongoDB 8.0 and KeyDB, with port 8122 published on 127.0.0.1 behind an HTTPS reverse proxy.
  3. Mount the uploads folder on /app/packages/server/static/upload: the path shown in the self-hosting page of the documentation is no longer the one the 3.0 image writes to.
  4. Without an SMTP server, set VERIFY_USER_EMAIL to false to sign up, then close registration with APP_DISABLE_REGISTRATION once your account exists.
  5. Back up with mongodump, an archive of the uploads and your .env file. To update, change the image tag, then pull and recreate the container.

What HeyForm does

HeyForm builds conversational forms: one question at a time, on any screen, for surveys, quizzes, polls, registrations or contact requests. It is written in TypeScript, with a Node.js server, a React editor and MongoDB to store forms and answers.

A published form has its own address on your domain, which you share as a link or embed in a page of your website.

What the AGPL-3.0 license allows

HeyForm is published under the GNU Affero General Public License, version 3 (AGPL-3.0). You can run it free of charge, as it is, for your company, your association or your clients. If you modify it, you publish your modifications under the same license, including when people only use your version over the network.

Its license page adds what it expects from anyone who sells a modified version: the source of the changes, a prominent mention of the original project after sign-up, and a link to the forked repository. Nothing in this guide modifies the code.

The resources to plan for

HeyForm runs as three containers: the application, MongoDB for the data and KeyDB, a Redis-compatible store, for the job queue and the counters that protect sign-in and uploads. Here is what we measured on our test VPS, with 2 vCPU and 4 GB of memory, after the installation, a published form and its first answers:

Server size therefore depends on the number of forms and answers and on the other applications you run beside HeyForm. On a managed VPS, tell us about your usage and we will recommend the right size.

Installing with Docker Compose

The official image, heyform/community-edition, contains the server and the editor. On its first start, it creates the database it needs in MongoDB; there is no installer to go through. On a server with Docker Engine and its Compose plugin, installed from Docker’s repository for Ubuntu, create a folder such as /opt/heyform with an assets folder inside, and put this compose.yaml in it, based on the “Connect MongoDB with username and password” example of the documentation:

Terminal
mkdir -p /opt/heyform/assets
compose.yaml
services:
  heyform:
    image: heyform/community-edition:v3.0.7
    restart: unless-stopped
    depends_on:
      - mongo
      - keydb
    ports:
      - "127.0.0.1:8122:9157"
    environment:
      APP_HOMEPAGE_URL: https://heyform.example.com
      TRUST_PROXY: 1
      VERIFY_USER_EMAIL: "false"
      APP_DISABLE_REGISTRATION: "false"
      SESSION_KEY: ${SESSION_KEY:?set SESSION_KEY in .env}
      FORM_ENCRYPTION_KEY: ${FORM_ENCRYPTION_KEY:?set FORM_ENCRYPTION_KEY in .env}
      INTEGRATION_ENCRYPTION_KEY: ${INTEGRATION_ENCRYPTION_KEY:?set INTEGRATION_ENCRYPTION_KEY in .env}
      MONGO_URI: mongodb://mongo:27017/heyform?authSource=admin
      MONGO_USER: root
      MONGO_PASSWORD: ${MONGO_PASSWORD:?set MONGO_PASSWORD in .env}
      REDIS_HOST: keydb
      REDIS_PORT: 6379
    volumes:
      - ./assets:/app/packages/server/static/upload

  mongo:
    image: percona/percona-server-mongodb:8.0
    restart: unless-stopped
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD:?set MONGO_PASSWORD in .env}
    volumes:
      - mongodb_data:/data/db

  keydb:
    image: eqalpha/keydb:x86_64_v6.3.4
    restart: unless-stopped
    command: keydb-server --appendonly yes --protected-mode no
    volumes:
      - keydb_data:/data

volumes:
  mongodb_data:
  keydb_data:

The four secrets go in a .env file next to it, which Docker Compose reads on its own. Create it readable by root only, then start the stack:

Terminal, in /opt/heyform
umask 077
printf 'SESSION_KEY=%s\nFORM_ENCRYPTION_KEY=%s\nINTEGRATION_ENCRYPTION_KEY=%s\nMONGO_PASSWORD=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" "$(openssl rand -hex 24)" > .env
umask 022
docker compose up -d
docker compose ps

On our test VPS, HeyForm answered about 15 seconds after the first start, images downloaded. To check that it is ready, with its two services:

Terminal, in /opt/heyform
curl -s http://127.0.0.1:8122/health/ready

The answer is a short JSON object, with "status":"ok" and "mongo":"up" and "redis":"up" in its checks.

HTTPS: the reverse proxy

The container serves HeyForm over HTTP, on port 8122 of the server, and the image marks its cookies secure: they only work over HTTPS. HTTPS is handled by a reverse proxy in front of it. We tested Caddy, installed from its official Debian and Ubuntu repository: it obtains the Let’s Encrypt certificate itself, renews it, and forwards the Host and X-Forwarded-For headers by default.

/etc/caddy/Caddyfile
heyform.example.com {
	reverse_proxy 127.0.0.1:8122
}
Terminal
sudo systemctl reload caddy

To check the result from the server:

Terminal
curl -sI https://heyform.example.com/sign-up

Caddy answers with HTTP/2 200, and the page carries the security headers HeyForm sets, such as strict-transport-security.

The first account, then closed registration

Open your address and choose Sign up: a name, an email address and a password with lowercase and uppercase letters and a digit. With VERIFY_USER_EMAIL off, the account is active at once, without a code. A new account starts with no workspace: create one, with a first project inside it.

Registration is open to anyone who finds the address, so close it once your account exists. Invitations still work: a person you invite to a workspace can create an account through the invitation link.

Terminal, in /opt/heyform
sed -i "s/APP_DISABLE_REGISTRATION: \"false\"/APP_DISABLE_REGISTRATION: \"true\"/" compose.yaml
docker compose up -d

On our test VPS, the container was recreated in a few seconds, a second sign-up was refused with “Registration is disabled”, and the first account still signed in.

A first form and its answers

In your project, create a form, add your questions, then publish it: it gets an address such as https://heyform.example.com/form/ followed by its identifier, to share as a link or embed in a page. We built one with a short text question and a file upload, published it, then answered it as a visitor with a small PNG file. The answer appeared in the form’s results with the file, served from /static/upload/, and the file was in the assets folder of the server.

Emails

HeyForm sends answer notifications, workspace invitations, verification codes and password resets by email. Add the SMTP settings to the environment of the heyform service, then run docker compose up -d: SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD and SMTP_FROM, the password preferably in .env like the other secrets. SMTP_SECURE turns on TLS from the start of the connection, the setting of port 465. Once a test email arrives, you can set VERIFY_USER_EMAIL back to "true".

On a Simafri VPS, applications send through an authenticated SMTP relay on port 587, which also gives your email the best deliverability. Our test VPS had no relay, so we did not test sending.

Backups

Everything lives in three places: the MongoDB database, with your forms, answers and accounts; the assets folder, with the files your respondents uploaded; and your .env file. Keep the latter safe: without INTEGRATION_ENCRYPTION_KEY, every connected account and API key of your integrations has to be entered again, as the server’s example configuration warns. KeyDB holds the job queue and short-lived counters such as rate limits and verification codes; this guide leaves it out of the backup. The Percona image includes mongodump:

Terminal, in /opt/heyform
umask 077
docker compose exec -T mongo mongodump --username root --password "$(grep ^MONGO_PASSWORD= .env | cut -d= -f2)" --authenticationDatabase admin --db heyform --archive --gzip > heyform-$(date +%F).archive.gz
tar -czf assets-$(date +%F).tar.gz assets
cp .env env-$(date +%F).bak
umask 022

The three files are readable by root only. Schedule this copy and send it off the server. Stored on the disk, the files are also included in the server’s nightly backups.

Restoring

On the same installation, or on a new one with the same compose.yaml and .env, stop the application, load the archive and the files, then start it again. --drop replaces each collection with the one in the archive, and --stopOnError stops the restore at the first error instead of carrying on:

Terminal, in /opt/heyform
BACKUP_DATE=2026-11-20
(
  set -e
  for f in heyform-$BACKUP_DATE.archive.gz assets-$BACKUP_DATE.tar.gz; do
    test -s "$f" || { echo "Missing or empty: $f"; exit 1; }
  done
  docker compose stop heyform
  docker compose exec -T mongo mongorestore --username root --password "$(grep ^MONGO_PASSWORD= .env | cut -d= -f2)" --authenticationDatabase admin --nsInclude "heyform.*" --drop --stopOnError --archive --gzip < heyform-$BACKUP_DATE.archive.gz
  tar -xzf assets-$BACKUP_DATE.tar.gz
  docker compose up -d
)

Set BACKUP_DATE, on the first line, to the date in the names of the backup you restore, as listed by ls. The commands run in parentheses with set -e, which stops them at the first error. They first check that each file exists and is not empty, before anything is stopped, removed or overwritten: a wrong date stops there, with your data untouched, and a failed step stops every step after it, so the application is never started again on a partial restore.

We tested the whole cycle on our VPS: archive and files, the heyform database actually dropped and the assets folder removed, then the restore. mongorestore reported 12 documents restored and 0 failed, the account signed in again, and the form came back with its answer and the uploaded file, byte for byte. Without --drop, over data already there, the same command stopped at the first duplicate and returned an error code, as expected.

Updates

HeyForm publishes its versions as GitHub releases, about two a month since October 2026, and the same tags on Docker Hub. This guide pins v3.0.7, the most recent when we tested it: read the release notes and check the tags page for a newer one before you install. Take a backup, change the tag in compose.yaml, then pull the new image and recreate the container:

Terminal, in /opt/heyform
sed -i "s|heyform/community-edition:v3.0.6|heyform/community-edition:v3.0.7|" compose.yaml
docker compose pull
docker compose up -d
docker compose exec heyform grep "\"version\"" package.json

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; HeyForm remains your software, with your forms, your answers 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 forms, your answers and your settings in HeyForm
HeyFormProactive monitoring: errors, slowdowns, database and disk space spotted, fix recommendedIts installation, updates and settings, which you apply, yourself or through your AI assistant
AccountsThe server that carries them, monitored and backed upWorkspaces, members and invitations
BackupsEvery night, encrypted and kept off the machine; restores includedHeyForm’s own database archives and uploads, 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.

HeyForm, on a server run for you

With a Simafri Managed VPS, our teams keep your HeyForm 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 HeyForm free?

Yes. HeyForm is under the AGPL-3.0 license: you can run it for your company, your association or your clients with no license to buy. If you modify it and offer it to others, you publish your changes. What remains is the cost of the server that runs it.

How do I install HeyForm with Docker Compose?

Use the heyform/community-edition image with Percona Server for MongoDB and KeyDB in a compose.yaml. Put SESSION_KEY, FORM_ENCRYPTION_KEY, INTEGRATION_ENCRYPTION_KEY and the MongoDB password in a .env file, set APP_HOMEPAGE_URL to your https address, mount the uploads on /app/packages/server/static/upload, publish it on port 8122 of 127.0.0.1, run docker compose up -d, and put an HTTPS reverse proxy in front.

Why are my HeyForm uploads lost after a restart?

Because the volume probably points to /app/static/upload, the path of the older examples. The 3.0 image writes uploads to /app/packages/server/static/upload: mount your folder there, as the project’s test Compose file does, so the files survive when the container is recreated.

How do I sign up on HeyForm without an SMTP server?

Set VERIFY_USER_EMAIL to false: by default, a new account must confirm a code sent by email. Once your account exists, set APP_DISABLE_REGISTRATION to true so that nobody else can sign up, except through a workspace invitation.

How much memory does HeyForm need?

Little. On our test VPS, HeyForm used about 160 MB at rest, MongoDB about 270 MB and KeyDB about 15 MB, and the three images take about 1.8 GB of disk. The database and the uploads then grow with your answers.

How do I back up HeyForm in Docker?

Dump the heyform database with mongodump from the MongoDB container, archive the uploads folder and keep a copy of your .env file. Restore the dump with mongorestore, --drop and --stopOnError, and the archive with tar, the application stopped.

How do I update HeyForm in Docker?

Take a backup, change the image tag in compose.yaml, for example from v3.0.6 to v3.0.7, then run docker compose pull and docker compose up -d. Your forms, answers and files stay in the database and in the uploads folder.

Does a managed VPS cover HeyForm?

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