> ## Documentation Index
> Fetch the complete documentation index at: https://formbricks.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# One-Click Setup

> How to set up Formbricks instance with a one-click script

> [!NOTE]
>
> This only works with an Ubuntu machine, so ensure the underlying OS is verified beforehand!

If you’re looking to quickly set up a production instance of Formbricks on an Ubuntu server, this guide is for you. Using a convenient shell script, you can install everything—including Docker, Postgres DB, SpiceDB, and an SSL certificate—in just a few steps. The script takes care of all the dependencies and configuration for your server, making the process smooth and simple.

> [!NOTE]
>
> This setup uses **Traefik** as a **reverse proxy**, essential for directing incoming traffic to the correct
> container and enabling secure internet access to Formbricks. Traefik is chosen for its simplicity and
> automatic SSL management via Let’s Encrypt.

> [!WARNING]
>
> The bundled RustFS option in this one-click setup is designed for convenience on a single server. It is a
> good fit for small-scale or low-complexity self-hosted deployments, but it is not the ideal RustFS
> architecture for high-availability or larger production environments. For stricter production requirements,
> use external object storage or run a dedicated RustFS deployment separately from the Formbricks one-click
> stack.

> [!NOTE]
>
> The installer stores generated PostgreSQL, Hub, Cube, and AuthZed credentials in `./formbricks/.env` and
> restricts the file to `0600`. PostgreSQL has a raw password for the database plus a URL-encoded companion for
> connection strings. When bundled RustFS is enabled, its generated credentials are stored there too. Keep that
> file private, include it in your server backup plan, and avoid checking it into source control or copying it to
> shared locations.

> [!NOTE]
>
> For better RustFS performance and stability, prefer local SSD or NVMe-backed storage for the host volume
> behind `rustfs-data`. Avoid NFS and other network filesystems for bundled RustFS data, and use XFS on
> dedicated storage disks when you manage the host layout yourself.

For other operating systems or a more customized installation, please refer to the advanced installation guide with [Docker](https://formbricks.com/docs/self-hosting/setup/docker.md).

### Requirements

* An Ubuntu Virtual Machine with SSH access.

* A custom domain with an **A record** pointing to your server.

* Ports **80** and **443** are open in your VM's Security Group, allowing Traefik to create an SSL certificate.

### Deployment

Run this command in your terminal:

```bash theme={null}
curl -fsSL https://raw.githubusercontent.com/formbricks/formbricks/stable/docker/formbricks.sh -o formbricks.sh && chmod +x formbricks.sh && ./formbricks.sh install
```

> [!NOTE]
>
> The v6 one-click stack is based on the production Docker Compose file and includes the Formbricks Hub API,
> `hub-worker`, and Cube as part of the baseline (Cube configuration lives under `formbricks/cube/`). Ensure your
> generated `formbricks/docker-compose.yml` contains the worker service and a non-empty `HUB_API_KEY`, and that
> `formbricks/.env` contains `CUBEJS_API_SECRET`, `AUTHZED_TOKEN`, and `AUTHZED_DATABASE_PASSWORD` before
> treating the stack as ready. The installer generates these values without printing them and restricts `.env`
> to `0600`. `HUB_API_URL` should normally stay at `http://hub:8080`. Bundled SpiceDB is installed for every new
> setup and does not require an Enterprise license check.

> [!NOTE]
>
> The v5 one-click Traefik setup also exposes Hub-backed FeedbackRecords through Formbricks at
> `/api/v3/feedbackRecords` and `/v1/feedback-records`. Traefik calls the internal Formbricks gateway auth
> endpoint first, then forwards allowed requests to Hub with the generated `HUB_API_KEY`. Browser callers should
> request short-lived gateway tokens from `/api/v3/gateway/token` with `{ "service": "feedbackRecords" }`.

### Script Prompts

During installation, the script will prompt you to provide some details:

* **Overwriting Docker GPG Keys**:
  If Docker GPG keys already exist, the script will ask whether you want to overwrite them.

```
🚀 Executing default step of installing Formbricks
🧱 Welcome to the Formbricks Setup Script

🛸 Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 24.04 LTS server.

🧹 Time to sweep away any old Docker installations.
🔄 Updating your package list.
📦 Installing the necessary dependencies.
🔑 Adding Docker's official GPG key and setting up the stable repository.
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N)
```

* **Domain Name**:
  Enter the domain name where you’ll host Formbricks. The domain will be used to generate an SSL certificate. Do not include the protocol (http/https).

```
🚀 Executing default step of installing Formbricks
🧱 Welcome to the Formbricks Setup Script

🛸 Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 24.04 LTS server.

🧹 Time to sweep away any old Docker installations.
🔄 Updating your package list.
📦 Installing the necessary dependencies.
🔑 Adding Docker's official GPG key and setting up the stable repository.
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N) y
🔄 Updating your package list again.
🐳 Installing Docker.
🚀 Testing your Docker installation.
🎉 Docker is installed!
🐳 Adding your user to the Docker group to avoid using sudo with docker commands.
🎉 Hooray! Docker is all set and ready to go. You're now ready to run your Formbricks instance!
📁 Created Formbricks Quickstart directory at ./formbricks.
🔗 Please enter your domain name for the SSL certificate (🚨 do NOT enter the protocol (http/https/etc)):
```

* **HTTPS Certificate Setup**:
  The script will ask if you’d like to create an HTTPS certificate for your domain. Enter `Y` to proceed (highly recommended for secure access).

```
🚀 Executing default step of installing Formbricks
🧱 Welcome to the Formbricks Setup Script

🛸 Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 24.04 LTS server.

🧹 Time to sweep away any old Docker installations.
🔄 Updating your package list.
📦 Installing the necessary dependencies.
🔑 Adding Docker's official GPG key and setting up the stable repository.
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N) y
🔄 Updating your package list again.
🐳 Installing Docker.
🚀 Testing your Docker installation.
🎉 Docker is installed!
🐳 Adding your user to the Docker group to avoid using sudo with docker commands.
🎉 Hooray! Docker is all set and ready to go. You're now ready to run your Formbricks instance!
📁 Created Formbricks Quickstart directory at ./formbricks.
🔗 Please enter your domain name for the SSL certificate (🚨 do NOT enter the protocol (http/https/etc)):
my.hosted.url.com
🔗 Do you want us to set up an HTTPS certificate for you? [Y/n]
```

* **DNS Setup Prompt**: Ensure that your domain's DNS is correctly configured and ports 80 and 443 are open. Confirm this by entering `Y`. This step is crucial for proper SSL certificate issuance and secure server access.

```
🚀 Executing default step of installing Formbricks
🧱 Welcome to the Formbricks Setup Script

🛸 Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 24.04 LTS server.

🧹 Time to sweep away any old Docker installations.
🔄 Updating your package list.
📦 Installing the necessary dependencies.
🔑 Adding Docker's official GPG key and setting up the stable repository.
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N) y
🔄 Updating your package list again.
🐳 Installing Docker.
🚀 Testing your Docker installation.
🎉 Docker is installed!
🐳 Adding your user to the Docker group to avoid using sudo with docker commands.
🎉 Hooray! Docker is all set and ready to go. You're now ready to run your Formbricks instance!
📁 Created Formbricks Quickstart directory at ./formbricks.
🔗 Please enter your domain name for the SSL certificate (🚨 do NOT enter the protocol (http/https/etc)):
my.hosted.url.com
🔗 Do you want us to set up an HTTPS certificate for you? [Y/n]
Y
🔗 Please make sure that the domain points to the server's IP address and that ports 80 & 443 are open in your server's firewall. Is everything set up? [Y/n]
```

* **Email Address for SSL Certificate**:
  Provide an email address to register the SSL certificate. Notifications regarding the certificate will be sent to this address.

```
🚀 Executing default step of installing Formbricks
🧱 Welcome to the Formbricks Setup Script

🛸 Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 24.04 LTS server.

🧹 Time to sweep away any old Docker installations.
🔄 Updating your package list.
📦 Installing the necessary dependencies.
🔑 Adding Docker's official GPG key and setting up the stable repository.
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N) y
🔄 Updating your package list again.
🐳 Installing Docker.
🚀 Testing your Docker installation.
🎉 Docker is installed!
🐳 Adding your user to the Docker group to avoid using sudo with docker commands.
🎉 Hooray! Docker is all set and ready to go. You're now ready to run your Formbricks instance!
📁 Created Formbricks Quickstart directory at ./formbricks.
🔗 Please enter your domain name for the SSL certificate (🚨 do NOT enter the protocol (http/https/etc)):
my.hosted.url.com
🔗 Do you want us to set up an HTTPS certificate for you? [Y/n]
Y
🔗 Please make sure that the domain points to the server's IP address and that ports 80 & 443 are open in your server's firewall. Is everything set up? [Y/n]
Y
💡 Please enter your email address for the SSL certificate:
```

* **Enforce HTTPS with HSTS**:
  Enabling HTTP Strict Transport Security (HSTS) ensures all communication with your server is encrypted. It’s a recommended best practice. Enter `Y` to enforce HTTPS.

```
🚀 Executing default step of installing Formbricks
🧱 Welcome to the Formbricks Setup Script

🛸 Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 24.04 LTS server.

🧹 Time to sweep away any old Docker installations.
🔄 Updating your package list.
📦 Installing the necessary dependencies.
🔑 Adding Docker's official GPG key and setting up the stable repository.
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N) y
🔄 Updating your package list again.
🐳 Installing Docker.
🚀 Testing your Docker installation.
🎉 Docker is installed!
🐳 Adding your user to the Docker group to avoid using sudo with docker commands.
🎉 Hooray! Docker is all set and ready to go. You're now ready to run your Formbricks instance!
📁 Created Formbricks Quickstart directory at ./formbricks.
🔗 Please enter your domain name for the SSL certificate (🚨 do NOT enter the protocol (http/https/etc)):
my.hosted.url.com
🔗 Do you want us to set up an HTTPS certificate for you? [Y/n]
Y
🔗 Please make sure that the domain points to the server's IP address and that ports 80 & 443 are open in your server's firewall. Is everything set up? [Y/n]
Y
💡 Please enter your email address for the SSL certificate:
docs@formbricks.com
🔗 Do you want to enforce HTTPS (HSTS)? [Y/n]
```

* **Email Service Setup Prompt**: The script will ask if you want to set up the email service. Enter `Y` to proceed.(default is `N`). You can skip this step if you don't want to set up the email service. You will still be able to use Formbricks without setting up the email service.

```
🚀 Executing default step of installing Formbricks
🧱 Welcome to the Formbricks Setup Script

🛸 Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 24.04 LTS server.

🧹 Time to sweep away any old Docker installations.
🔄 Updating your package list.
📦 Installing the necessary dependencies.
🔑 Adding Docker's official GPG key and setting up the stable repository.
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N) y
🔄 Updating your package list again.
🐳 Installing Docker.
🚀 Testing your Docker installation.
🎉 Docker is installed!
🐳 Adding your user to the Docker group to avoid using sudo with docker commands.
🎉 Hooray! Docker is all set and ready to go. You're now ready to run your Formbricks instance!
📁 Created Formbricks Quickstart directory at ./formbricks.
🔗 Please enter your domain name for the SSL certificate (🚨 do NOT enter the protocol (http/https/etc)):
my.hosted.url.com
🔗 Do you want us to set up an HTTPS certificate for you? [Y/n]
Y
🔗 Please make sure that the domain points to the server's IP address and that ports 80 & 443 are open in your server's firewall. Is everything set up? [Y/n]
Y
💡 Please enter your email address for the SSL certificate:
docs@formbricks.com
🔗 Do you want to enforce HTTPS (HSTS)? [Y/n]
Y
🚗 Configuring Traefik...
💡 Created traefik.yaml and traefik-dynamic.yaml file.
💡 Created acme.json file with correct permissions.
📧 Do you want to set up the email service? You will need SMTP credentials for the same! [y/N]

```

**That's it**! After running the command and providing the required information, visit the domain name you entered, and you should see the Formbricks home wizard!

```
🚀 Executing default step of installing Formbricks
🧱 Welcome to the Formbricks Setup Script

🛸 Fasten your seatbelts! We're setting up your Formbricks environment on your Ubuntu 24.04 LTS server.

🧹 Time to sweep away any old Docker installations.
🔄 Updating your package list.
📦 Installing the necessary dependencies.
🔑 Adding Docker's official GPG key and setting up the stable repository.
File '/etc/apt/keyrings/docker.gpg' exists. Overwrite? (y/N) y
🔄 Updating your package list again.
🐳 Installing Docker.
🚀 Testing your Docker installation.
🎉 Docker is installed!
🐳 Adding your user to the Docker group to avoid using sudo with docker commands.
🎉 Hooray! Docker is all set and ready to go. You're now ready to run your Formbricks instance!
📁 Created Formbricks Quickstart directory at ./formbricks.
🔗 Please enter your domain name for the SSL certificate (🚨 do NOT enter the protocol (http/https/etc)):
my.hosted.url.com
🔗 Do you want us to set up an HTTPS certificate for you? [Y/n]
Y
🔗 Please make sure that the domain points to the server's IP address and that ports 80 & 443 are open in your server's firewall. Is everything set up? [Y/n]
Y
💡 Please enter your email address for the SSL certificate:
docs@formbricks.com
🔗 Do you want to enforce HTTPS (HSTS)? [Y/n]
Y
🚗 Configuring Traefik...
💡 Created traefik.yaml and traefik-dynamic.yaml file.
💡 Created acme.json file with correct permissions.
📧 Do you want to set up the email service? You will need SMTP credentials for the same! [y/N] N
📥 Downloading docker-compose.yml from Formbricks GitHub repository...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6632  100  6632    0     0  24280      0 --:--:-- --:--:-- --:--:-- 24382
🚙 Updating docker-compose.yml with your custom inputs...
🚗 BETTER_AUTH_SECRET updated successfully!
🚗 ENCRYPTION_KEY updated successfully!
🚗 CRON_SECRET updated successfully!

[+] Running 4/4
 ✔ Network formbricks_default         Created                                                                                                                                                    0.2s
 ✔ Container formbricks-postgres-1    Started                                                                                                                                                    1.0s
 ✔ Container formbricks-formbricks-1  Started                                                                                                                                                    1.6s
 ✔ Container traefik                  Started                                                                                                                                                    2.8s
🔗 To edit more variables and deeper config, go to the formbricks/docker-compose.yml, edit the file, and restart the container!
🚨 Make sure you have set up the DNS records as well as inbound rules for the domain name and IP address of this instance.

🎉 All done! Please setup your Formbricks instance by visiting your domain at https://my.hosted.url.com. You can check the status of Formbricks & Traefik with 'cd formbricks && sudo docker compose ps.'
```

## Update

To update Formbricks for a minor or patch release, first go to the directory that contains your
`formbricks/` folder. Download the current stable updater there, replacing any older `formbricks.sh`, and
then run it:

```bash theme={null}
curl -fsSL https://raw.githubusercontent.com/formbricks/formbricks/stable/docker/formbricks.sh \
  -o formbricks.sh
chmod +x formbricks.sh
./formbricks.sh update
```

The script first validates the resolved Compose project and warns — without stopping — when the baseline
`hub-worker` is missing, then pulls images and runs the read-only AuthZed upgrade check. A failed preflight leaves
the existing application running.
Otherwise it stops the stack, waits for PostgreSQL, completes application migrations, and only then starts the
new stack. A failed migration leaves the stack stopped for recovery; preparation is never run against a live
installation by the updater.

Once those checks pass, the update also publishes the Formbricks container's port `3000` on `127.0.0.1` only, if
your `docker-compose.yml` or your Compose override file (such as `docker-compose.override.yml`) still publishes it on
every interface (`- 3000:3000`). Traefik reaches Formbricks over the Compose network and keeps serving it on ports
`80` and `443`, so outside traffic always passes through Traefik. Each file it changes is kept as
`<file>.before-loopback-port`. Before stopping anything, it renders the Compose files exactly as Docker Compose will
load them and checks that they publish port `3000` once, on `127.0.0.1`; if not, it restores the files it changed and
continues the update with the port as it was. A mapping with an address you chose, such as `- 0.0.0.0:3000:3000`, is
left as it is, and so is everything when `.env` sets `COMPOSE_FILE`. On Docker Engine before 28.0, and on 28.2.0 to
28.3.2, other machines on your local network can still reach a port published on `127.0.0.1`, so the installer and
the update warn you to upgrade Docker.

Starting with v5.4, the updater also recognizes the old amd64-only bundled Valkey digest. It backs up your
Compose file, replaces only that exact image reference with the native amd64/arm64 digest, and validates the
result before pulling. An already-updated or custom Valkey image is left unchanged. The named `redis` volume
and its AOF data are preserved.

While the stack is stopped, the updater also refreshes the bundled Cube model (`cube/cube.js` and
`cube/schema/FeedbackRecords.js`), so analytics charts can use members a release adds. It downloads the files
of the release your Formbricks image runs: the `stable` branch for `latest`, or the tag the image is pinned to.
It keeps the previous files in `cube/previous/`. The two files change together: if either cannot be
downloaded, backed up or replaced, both stay as they were, the update finishes, and the updater prints the
command to retry, `./formbricks.sh refresh-cube`. An image pinned to anything else, such as a digest, leaves
both files unchanged.

Existing one-click installations keep the database credentials in their local `docker-compose.yml` or `.env`.
The update command does not regenerate or rotate them.

> [!WARNING]
>
> Apart from the exact v5.4 Valkey pin migration and the port `3000` narrowing described above,
> `./formbricks.sh update` does **not** rewrite your existing `formbricks/docker-compose.yml`. For a major migration such as Formbricks 4.x to 5.0, follow
> the [migration guide](https://formbricks.com/docs/self-hosting/advanced/migration.md#v5) first, merge the current v5 Compose changes into
> your existing deployment, confirm `HUB_API_KEY` is set, and only then run the update command. If your older
> one-click install also uses bundled MinIO for file uploads, review that storage path separately before the
> first v5 restart; newer self-hosting updates move the bundled object-storage path to RustFS, while external
> S3-compatible storage keeps the same `S3_*` app contract. The updater warns and continues when the Compose
> project is missing the release-matched `hub-worker`; adding it is recommended, and the next major release will
> require it — see the
> [Hub worker migration](https://formbricks.com/docs/self-hosting/advanced/migration.md#hub-worker-for-docker). The v6 updater also requires the
> release-matched AuthZed services and requires `.env` to contain
> `FORMBRICKS_AUTHZED_V6_MIGRATION_ACKNOWLEDGED=true` after a clean preparation.
>
> The same applies to pinned third-party images. Because the update command only re-pulls what your Compose
> file already names, a bundled `rustfs` service stays on whatever version it was installed with — `docker
>     compose pull` cannot move a pinned tag. To take a newer RustFS, edit the `image:` line of the `rustfs`
> service in `formbricks/docker-compose.yml` to match the version in the [Docker
> guide](https://formbricks.com/docs/self-hosting/setup/docker.md), then run the update command. Your `rustfs-data` volume is reused as-is;
> roll back by restoring the previous `image:` line.

### Add SpiceDB to an Existing One-Click Installation

The update command intentionally preserves your customized Compose file, so it cannot add SpiceDB by itself.
Before upgrading to a release that uses AuthZed:

1. Follow the [maintenance upgrade guide](https://formbricks.com/docs/self-hosting/advanced/v6-maintenance-upgrade.md): stop writers and
   controllers, drain in-flight work, then back up configuration, secrets, and databases.
2. Download the release-matched `authzed-postgres-bootstrap.sh` into the `formbricks` directory.
3. Generate and add `AUTHZED_TOKEN` and `AUTHZED_DATABASE_PASSWORD` to `.env` using `openssl rand -hex 32`.
4. Merge `authzed-db-bootstrap`, `spicedb-migrate`, `spicedb`, `authzed-initialize`, and the profiled
   `authzed-ops` service from the released Compose file while preserving installer-added Traefik, storage, and
   mail configuration. Add the six application variables and use `AUTHZED_CONSISTENCY=fully_consistent`.
5. Validate the target Compose file privately and pull the pinned images from the `formbricks` directory.
   Keep maintenance active and writers stopped.
6. Wait for the datastores, then run migrations, preparation, and verification using the target image:

   ```bash theme={null}
   docker compose up -d --wait postgres spicedb
   docker compose --profile authzed-ops run --rm --no-deps \
     --entrypoint formbricks-authzed-prepare authzed-ops \
     --backup-confirmed --writers-stopped
   ```

   A mismatched non-empty schema requires the reviewed digest described in the maintenance guide.
7. If preparation exits `0`, add `FORMBRICKS_AUTHZED_V6_MIGRATION_ACKNOWLEDGED=true` to `.env` and run
   `./formbricks.sh update`. Do not bypass a blocked check. Keep maintenance active until access tests pass.
8. Verify `authzed-db-bootstrap`, `spicedb-migrate`, and `authzed-initialize` completed and `spicedb` is healthy.
9. Back up the authorization database with
   `docker compose exec -T postgres pg_dump -U postgres -d spicedb > spicedb-backup.sql` and add it to your
   regular backup procedure.

Do not use `docker compose down -v` during this migration or rollback because the existing PostgreSQL volume
stores both Formbricks and SpiceDB data.

For upgrades, restoration, schema changes, and relationship repair, follow the canonical
[AuthZed Operations guide](https://formbricks.com/docs/self-hosting/configuration/authzed-operations.md).

## Stop

To stop Formbricks, simply run the following command:

```
./formbricks.sh stop
```

The script will automatically stop all the Formbricks related containers and brings the entire stack down.

## Restart

To restart Formbricks, simply run the following command:

```
./formbricks.sh restart
```

The script will automatically restart all the Formbricks related containers and brings the entire stack up with the previous configuration.

## Cleanup RustFS init (optional)

During the one-click setup, a temporary `rustfs-init` service configures RustFS (bucket, policy, service
user). It is idempotent and safe to leave in place; it will do nothing on subsequent starts once the
configuration exists.

If you prefer to remove the `rustfs-init` service and its references after a successful setup, run:

```
./formbricks.sh cleanup-rustfs-init
```

`./formbricks.sh cleanup-minio-init` is still available as a backward-compatible alias.

This only removes the init job and its Compose references; it does not delete any data or affect your RustFS
configuration.

## Uninstall

To uninstall Formbricks, simply run the following command, but keep in mind that this will delete all your data!

```
./formbricks.sh uninstall
```

The script will automatically stop all the Formbricks related containers, remove the Formbricks directory, and delete the Docker network.

## Debug

If you encounter any issues, you can check the logs of the containers with:

```
./formbricks.sh logs
```

## Troubleshooting

If you encounter any issues, consider the following steps:

* **Inbound Rules**: Make sure you have added inbound rules for Port 80 and 443 in your VM's Security Group.

* **A Record**: Verify that you have set up an A record for your domain, pointing to your VM's IP address.

* **Check Docker Instances**: Run `docker ps` to check the status of the Docker instances.

* **Check Formbricks Logs**: Run `cd formbricks && docker compose logs` to check the logs of the Formbricks stack.

If you have any questions or require help, feel free to reach out to us on [**GitHub Discussions**](https://github.com/formbricks/formbricks/discussions). 😃[
](https://formbricks.com/docs/developer-docs/rest-api)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.