# Self-host with Docker Compose

> Run Commentpin with Docker Compose: start the stack, sign in, back up the database and volumes, and update to a new version.

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

## How do I run Commentpin with Docker Compose?

Clone the repository, copy the example settings and start the stack. Docker Compose builds the app and runs it with Postgres, a cron runner and a test inbox.

## Start

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

Open `http://localhost:3000`. Enter your email, then open Mailpit at `http://localhost:8025` and click the sign-in link.

## Back up

Back up the database and the `appdata` volume:

```sh
docker compose exec postgres pg_dump -U postgres website_feedback > backup.sql
```

The volume holds uploaded screenshots and the generated secrets. Keep both.

## Update

```sh
git pull
docker compose up -d --build
```

Migrations run when the app starts.

## Next

Put it on a server with HTTPS: [running on a VPS](/docs/self-hosting/vps). All settings: [configuration](/docs/configuration). Then [install the widget](/docs/install-the-widget). Overview: [self-host](/self-host).

## FAQ

### Which services does the Compose file start?

app (the web app and API), postgres, cron (scheduled jobs) and mailpit (a test inbox).

### Where is my data?

In two Docker volumes: pgdata for the database and appdata for screenshots and generated secrets.

### Do migrations run automatically?

Yes. The app container runs database migrations every time it starts.

### How do I change the port?

Set APP_PORT in .env, for example APP_PORT=8080.

### How do I send real emails?

Set SMTP_HOST and the other SMTP values, or RESEND_API_KEY, in .env and restart.
