DingDocs
GitHub ↗Back to site

Self-Hosting

This page gives the production overview. The maintained operations procedures live in the Ding repository and are linked below.

1. Prepare the environment

Clone the repository on your server:

git clone https://github.com/UncleTeslim/ding
cd ding

Install dependencies and run the guided production setup:

npm install
npm run setup

npm run setup asks for the public HTTPS URL and generates the required production environment values. Review the generated .env; do not hand-author production secrets.

2. Run with Docker Compose

docker compose up --build -d --wait

Ding runs as one application container. SQLite is embedded in Ding itself, not a separate database container. Docker persists announcements and analytics in the named ding-data volume.

Check health locally on the server:

curl http://localhost:3000/health

Expected response:

{ "ok": true, "db": "connected" }

3. Configure a reverse proxy

Ding expects HTTPS to be handled by your reverse proxy.

Caddy

ding.example.com {
  reverse_proxy localhost:3000
}

Nginx

server {
  server_name ding.example.com;

  location / {
    proxy_pass http://localhost:3000;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }
}

4. Embed the widget

After the instance is reachable over HTTPS, embed the widget:

<script
  src="https://ding.example.com/widget.js"
  data-position="bottom-right"
  data-color="#155eef"
  data-trigger="both"
  async
></script>

Operations guides

Before upgrades, back up and verify the ding-data volume. Never use docker compose down -v for normal maintenance: it deletes the named volume and its embedded SQLite database.