# Deploy with Dokploy — OpenPanel Analytics

> Source: https://openpanel.dev/docs/self-hosting/deploy-dokploy
> Récupéré via WebFetch (le scrape Firecrawl ayant été refusé dans cette session) — contenu nettoyé, pas strictement verbatim.

## Overview

Dokploy is an open-source, self-hosted platform for deploying applications. OpenPanel can be deployed via a Docker Compose template with specific configuration requirements differing from Coolify.

## Prerequisites

- Dokploy instance installed and running
- Server with minimum 2GB RAM (4GB+ recommended)
- Configured domain name in Dokploy

## Quick Start Process

### Deploy Template
1. Log into Dokploy dashboard
2. Navigate to your project
3. Click "New Application" or "Deploy"
4. Select "Docker Compose" or search for "OpenPanel" template
5. Select the OpenPanel template

### Domain Configuration
The dashboard and API share the same domain. The API service uses a forward path to `/api`, requiring correct configuration.

### Critical Environment Variables

```
API_URL=https://yourdomain.com/api
DASHBOARD_URL=https://yourdomain.com

OPENPANEL_POSTGRES_DB=openpanel-db
SERVICE_USER_POSTGRES=postgres
SERVICE_PASSWORD_POSTGRES=<auto-generated>
SERVICE_PASSWORD_REDIS=<auto-generated>

OPENPANEL_ALLOW_REGISTRATION=false
OPENPANEL_ALLOW_INVITATION=true
RESEND_API_KEY=your-resend-api-key
OPENPANEL_EMAIL_SENDER=noreply@yourdomain.com
```

**Key Difference**: Unlike Coolify, Dokploy does not support `SERVICE_FQDN_*` variables — you must hardcode actual domain values.

### API Service Configuration

Configure the `op-api` service domain:
```
[[config.domains]]
serviceName = "op-api"
port = 3000
host = "${api_domain}"
```

**Critical**: Check the "Strip external path" checkbox for the API service. This ensures `/api` requests forward correctly without the prefix.

## Deployment Steps

1. Review all configuration
2. Click "Deploy" or "Save"
3. Wait for services to become healthy
4. Monitor deployment logs

## Verification

Confirm running services:
- `op-api` — API server
- `op-dashboard` — Dashboard (frontend)
- `op-worker` — Background worker
- `op-db` — PostgreSQL database
- `op-kv` — Redis cache
- `op-ch` — ClickHouse database

Access the dashboard at the configured domain and test account creation.

**Note**: If using Cloudflare, purge cache after changes.

## Troubleshooting

### API Requests Failing
- Verify environment variables match domain
- Confirm "Strip external path" is checked
- Test: `curl https://yourdomain.com/api/healthcheck`

### Account Creation Issues
- Check `op-api` logs in Dokploy
- Verify `API_URL` is `https://yourdomain.com/api` (not localhost)
- Ensure API service accessibility

### Database Connection Problems
- Verify services running: `op-db`, `op-kv`, `op-ch`
- Check environment variables with docker exec
- Match service names to connection strings

### Cloudflare Cache Issues
Purge Cloudflare cache after deployment to serve updated resources immediately.

## Docker Compose Services

The template includes six services: `op-api`, `op-dashboard`, `op-worker`, `op-db`, `op-kv`, and `op-ch`.

## Key Differences from Coolify

1. No `SERVICE_FQDN_*` variable support
2. Manual domain path configuration required
3. "Strip external path" must be enabled
4. Standard Docker Compose service names

## Updates

To update OpenPanel:
```
docker compose pull
docker compose up -d
```

Or use Dokploy's UI to restart services.

## Next Steps

- Configure email for password resets and invitations
- Set up AI integration for the analytics assistant
- Configure the SDK with the correct API URL for event tracking
