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.
By Simon Vasconcelos Lee
Published on 4 December 202612 minute read
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./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.VERIFY_USER_EMAIL to false to sign up, then close registration with APP_DISABLE_REGISTRATION once your account exists.mongodump, an archive of the uploads and your .env file. To update, change the image tag, then pull and recreate the container.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.
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.
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:
arm64_v6.3.4 tag of KeyDB.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.
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:
mkdir -p /opt/heyform/assets
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:
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
./assets on /app/static/upload. In the 3.0 image, the server runs from /app/packages/server and writes uploads to /app/packages/server/static/upload, the path the project’s own test Compose file uses; /app/static does not exist there. With the old path, uploaded files would stay inside the container and be lost when it is recreated. On our test VPS, the file sent with an answer landed in assets.127.0.0.1: the examples publish port 9157 on every address of the server. Published locally, HeyForm is reachable only through the reverse proxy, and that is the condition the project’s security notes set for TRUST_PROXY.TRUST_PROXY: 1 tells the server to trust exactly one proxy in front of it, Caddy here, for the client address it reads from X-Forwarded-For. It is off by default.VERIFY_USER_EMAIL: "false": by default, a new account must confirm a code sent by email. Without an SMTP server, nobody could finish signing up, as the server’s example configuration warns. Turn it back on once email is set up.SESSION_KEY protects the session cookies, FORM_ENCRYPTION_KEY the tokens of form visits, and INTEGRATION_ENCRYPTION_KEY the API keys and tokens of connected integrations, which stay unavailable without it. The examples use key1 and key2.root user on its first start, and HeyForm connects with it. Neither MongoDB nor KeyDB publishes a port: only the containers of this stack reach them.latest everywhere. HeyForm v3.0.7 lets you choose when each update happens; 8.0 follows the 8.0 release of Percona Server for MongoDB, the version line we tested, while its latest tag pointed to 8.3 that day; KeyDB 6.3.4 is its most recent release.mongodb_data holds the database, keydb_data the queue, and the assets folder the uploaded files.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:
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.
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.
heyform.example.com {
reverse_proxy 127.0.0.1:8122
}
sudo systemctl reload caddy
APP_HOMEPAGE_URL must be this exact address, with https://: HeyForm builds the links of your forms and uploads from it and takes the domain of its cookies from it. The documentation warns that a wrong value leads to login issues.To check the result from the server:
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.
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.
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.
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.
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.
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:
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.
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:
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.
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:
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
"version": "3.0.7", and the form, its answer and its file were all there. A new answer was then accepted by v3.0.7, which adds pseudonymous respondent IDs as an option of each form.latest tag follows every release: stay on a pinned version and move it yourself.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.
| Topic | Our teams | You |
|---|---|---|
| The server | System and security updates, server interventions included | The timing that suits you |
| Monitoring | Server monitored 24/7, with intervention without waiting for your call | Your forms, your answers and your settings in HeyForm |
| HeyForm | Proactive monitoring: errors, slowdowns, database and disk space spotted, fix recommended | Its installation, updates and settings, which you apply, yourself or through your AI assistant |
| Accounts | The server that carries them, monitored and backed up | Workspaces, members and invitations |
| Backups | Every night, encrypted and kept off the machine; restores included | HeyForm’s own database archives and uploads, and the restore request, when you need one |
| Migration | Your current server migrated, free of charge | The 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Simafri
Let's talk about your project
Tell us what you need in a few words: we will get back to you quickly.
Thank you! Your request has been sent. We'll get back to you shortly.
Prefer email? Write to us at support@simafri.com.