Deploying Rebase on Hetzner Cloud
Hetzner Cloud is widely recognized for offering incredible performance-to-price ratios and is a top choice for projects requiring strict European data sovereignty and GDPR compliance (with datacenters in Nuremberg, Falkenstein, and Helsinki).
Deploying Rebase on Hetzner is easiest via Docker Compose on a standard Ubuntu cloud instance.
1. Provision a Server
Section titled “1. Provision a Server”- Log into your Hetzner Cloud Console.
- Click Add Server.
- Choose your preferred Location (e.g., Falkenstein or Nuremberg).
- Choose an Image: Select Ubuntu 24.04 or App -> Docker CE (this pre-installs Docker for you).
- Choose a Type: A
CPX21(3 cores, 4GB RAM) orCX32(4 cores, 8GB RAM) provides excellent baseline compute for running Rebase + Postgres. - Add your SSH key and hit Create.
2. SSH and Setup
Section titled “2. SSH and Setup”Once your server is provisioned, grab the public IP address.
ssh root@<your-server-ip>If you didn’t choose the Docker image, install Docker and Docker Compose explicitly:
apt update && apt install docker.io docker-compose-v2 -y3. Clone and Configure Rebase
Section titled “3. Clone and Configure Rebase”Clone your Rebase project directly onto the server instance.
git clone https://github.com/your-username/your-rebase-repo.git /opt/rebasecd /opt/rebaseRebase provides a docker-compose.yml out of the box. You’ll need to define your production environment variables. Create a .env.production file:
nano .env.productionAdd your secrets:
DATABASE_URL=postgresql://rebase:your_secure_db_password@postgres:5432/rebaseJWT_SECRET=generate_a_very_long_secure_random_string_hereNODE_ENV=productionBe sure to update docker-compose.yml if you want to pull the Postgres password from an environment variable.
4. Run the Stack
Section titled “4. Run the Stack”Bring the stack online using detached mode:
docker compose --env-file .env.production up -d --buildDocker will build your Node.js backend from the local Dockerfile and spin up the Postgres container. Once completed, your app will be running on http://localhost:3001 (internal to the server).
5. Expose via Caddy or Nginx
Section titled “5. Expose via Caddy or Nginx”You should never expose port 3001 directly to the internet without SSL. We recommend placing Caddy in front of your Rebase instance to automatically provision Let’s Encrypt certificates.
Install Caddy:
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-httpscurl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpgcurl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.listsudo apt update && sudo apt install caddyEdit your Caddyfile:
nano /etc/caddy/CaddyfileAdd the following (replace with your domain, which should have its A-Record pointing to this Hetzner IP):
admin.yourdomain.com { reverse_proxy localhost:3001}Restart Caddy:
systemctl restart caddyThat’s it! Your Rebase platform is securely hosted entirely within the EU.