# Run on a VPS with HTTPS

> Run Commentpin on a VPS behind HTTPS with Caddy: point a domain, set APP_URL, start Docker Compose and set up real email.

Source: https://commentpin.com/docs/self-hosting/vps
Last updated: 2026-12-02

## How do I run Commentpin on a VPS with HTTPS?

Run the Docker Compose stack on the server and put a reverse proxy in front of it for HTTPS. This guide uses Caddy, which gets certificates automatically.

## 1. Prepare the server

Any Linux server with Docker and Docker Compose works. Point a DNS record, for example `feedback.example.com`, at the server's IP address.

## 2. Configure

```sh
git clone https://github.com/aaronyarm/website-feedback && cd website-feedback
cp .env.example .env
```

In `.env`, set:

```sh
APP_URL=https://feedback.example.com
EMAIL_FROM="Feedback <feedback@example.com>"
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=your-user
SMTP_PASSWORD=your-password
# Listen on the server itself only; Caddy is the public entry point.
APP_PORT=127.0.0.1:3000
```

## 3. Start

```sh
docker compose up -d
```

The app listens on `127.0.0.1:3000`, so it is reachable only from the server itself. `APP_URL` is built into the pages, so if you change it later, run `docker compose up -d --build`.

Keep the app behind the proxy. Rate limits read the visitor's address from the `X-Forwarded-For` header that Caddy sets. If the app port is open to the internet, a visitor can send that header themselves and get around the limits.

## 4. Add HTTPS with Caddy

Install Caddy, then use this `Caddyfile`:

```text
feedback.example.com {
    reverse_proxy localhost:3000
}
```

Reload Caddy. Open `https://feedback.example.com` and sign in.

## 5. Keep it private

Allow only ports 22, 80 and 443 in your firewall. Docker port mappings can bypass host firewalls such as ufw, which is why `APP_PORT` binds to `127.0.0.1`. Mailpit is already bound to `127.0.0.1:8025`, and is not needed once real email is set up.

More: [Docker Compose](/docs/self-hosting/docker), [configuration](/docs/configuration), [self-host overview](/self-host).
