Run on a VPS with HTTPS
Last updated:
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
git clone https://github.com/aaronyarm/website-feedback && cd website-feedback
cp .env.example .env
In .env, set:
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
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:
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.