This guide is for complete beginners.
By the end, you will have Comet running and reachable from your browser.
- A machine with Docker and Docker Compose installed.
- A terminal.
- A text editor.
mkdir comet-deploy
cd comet-deployCopy deployment/docker-compose.yml from this repository into your working directory as docker-compose.yml.
This compose file starts:
cometon port8000postgresas the database
Create a .env file in the same directory.
Example:
# Change this before exposing Comet publicly
ADMIN_DASHBOARD_PASSWORD=change-me-nowNotes:
- Comet runtime defaults come from
AppSettingsincomet/core/models.py. .env-sampleis a reference template of available options.
docker compose up -ddocker compose ps
docker compose logs -f cometIn logs, confirm startup information appears.
You can also check health:
http://<your-host>:8000/healthshould return{"status":"ok"}.
Open:
http://<your-host>:8000/configurefor configurationhttp://<your-host>:8000/adminfor admin dashboard login
If ADMIN_DASHBOARD_PASSWORD is not set, Comet generates one at startup and logs it.
For beginner self-hosting, a reverse proxy is the simplest path to use a domain name and HTTPS.
Requirements:
- An A record on your domain pointing towards your IP.
- Ports 443 and 80 open.
Tip
You can also use services such as DuckDNS as a free alternative to buying a domain.
Comet includes a minimal nginx example in deployment/nginx.conf:
server {
server_name example.com;
location / {
proxy_pass http://localhost:8000;
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;
}
}Beginner checklist:
- Replace
example.comwith your domain. - Ensure
proxy_passpoints to your Comet service. - Add HTTPS/TLS on the proxy before using Stremio from another device/network.
Add the following example from below into your compose file:
traefik:
image: traefik:v3
container_name: traefik
restart: unless-stopped
environment:
- TZ=Etc/UTC # change this if needed
ports:
- 443:443
command:
- '--ping=true'
- '--api=true'
- '--api.dashboard=false'
- '--api.insecure=false'
- '--global.sendAnonymousUsage=false'
- '--global.checkNewVersion=false'
- '--log=true'
- '--log.level=DEBUG'
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entryPoints.websecure.address=:443"
- "--certificatesresolvers.letsencrypt.acme.tlschallenge=true"
- "--certificatesresolvers.letsencrypt.acme.email=youremail@example.com"
- "--certificatesresolvers.letsencrypt.acme.storage=/config/acme.json"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "./traefik:/config"
healthcheck:
test: ["CMD", "traefik", "healthcheck", "--ping"]
interval: 10s
timeout: 5s
retries: 3
- Replace "youremail@example.com" with your email (used for Let's Encrypt)
Then, add this to the labels of your comet:
labels:
- "traefik.enable=true"
- "traefik.http.routers.comet.rule=Host(`comet.example.com`)"
- "traefik.http.routers.comet.entrypoints=websecure"
- "traefik.http.routers.comet.tls.certresolver=letsencrypt"
Example:
services:
comet:
container_name: comet
image: g0ldyy/comet
restart: unless-stopped
ports:
- "8000:8000"
environment:
DATABASE_TYPE: ${DATABASE_TYPE:-postgresql}
DATABASE_URL: ${DATABASE_URL:-comet:comet@postgres:5432/comet}
env_file:
- .env
volumes:
- comet_data:/app/data
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8000/health"]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
depends_on:
postgres:
condition: service_healthy
labels:
- "traefik.enable=true"
- "traefik.http.routers.comet.rule=Host(`comet.example.com`)"
- "traefik.http.routers.comet.entrypoints=websecure"
- "traefik.http.routers.comet.tls.certresolver=letsencrypt"
- Replace
comet.example.comwith your hostname.
Now run this command:
sudo docker compose up -d
Continue with Configure and Install in Stremio.