Self-Hosting
One-Click Setup
If you want to quickly set up a production instance of Formbricks on a server running Ubuntu, we've got you covered! This method utilizes a convenient shell script that takes care of everything, including Docker, Postgres DB, and SSL certificate configuration. The shell script will automatically install all the required dependencies and configure your server, making the process a breeze.
This setup installs Traefik to work as a reverse proxy. This configuration is crucial for directing incoming traffic to the correct container, allowing Formbricks to be accessible from the internet securely. Traefik is chosen for its simplicity and automatic SSL management with Let's Encrypt.
If you want to run Formbricks on a different OS or have more control over the installation process, you can follow the advanced installation guide with Docker.
Requirements
Before you proceed, make sure you have the following:
- A Linux Ubuntu Virtual Machine deployed with SSH access.
- An A record set up to connect a custom domain to your instance. Formbricks will automatically create an SSL certificate for your domain using Let's Encrypt.
- Port 80 and 443 open in your VM's Security Group to allow Traefik to create the SSL certificate.
Start
Copy and paste the following command into your terminal:
Single Command to deploy Formbricks
curl -fsSL https://raw.githubusercontent.com/formbricks/formbricks/main/docker/formbricks.sh -o formbricks.sh && chmod +x formbricks.sh && ./formbricks.sh install
The script will prompt you for the following information:
- Overwriting Docker GPG Keys: If Docker GPG keys already exist, the script will ask if you want to overwrite them.
Docker GPG Keys Overwrite Prompt
π 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: You will be asked to enter the domain name where you want to host Formbricks. This domain will be used to generate an SSL certificate.
Email Prompt
π 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 Prompt: The script will ask if you want to create an HTTPS certificate for your domain. Enter Y to proceed. This is highly recommended for secure access to your Formbricks instance.
π 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: Provide an email address for SSL certificate registration. This email will be used for notifications regarding your SSL certificate from Let's Encrypt.
Email Prompt
π 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 (HSTS) Prompt: Enforcing HTTPS with HSTS is a good security practice, as it ensures all communication with your server is encrypted. Enter Y to enable this setting.
Domain Name for SSL certificate Prompt
π 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:
[email protected]
π 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 isN
). 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:
[email protected]
π 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!
Successfully setup Formbricks on your Ubuntu machine
π 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:
[email protected]
π 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...
π NEXTAUTH_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, simply run the following command:
Update Formbricks
./formbricks.sh update
The script will automatically pull the latest version of Formbricks from GitHub Container Registry and restart the containers.
Stop
To stop Formbricks, simply run the following command:
Stop Formbricks
./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:
Restart Formbricks
./formbricks.sh restart
The script will automatically restart all the Formbricks related containers and brings the entire stack up with the previous configuration.
Uninstall
To uninstall Formbricks, simply run the following command, but keep in mind that this will delete all your data!
Uninstall Formbricks
./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:
Check logs of the container
./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.