Dokploy on Your Own Server. Part 2: Installing and configuring Dokploy

All parts of the series “Dokploy on Your Own Server”

In part one, we looked at the problem Dokploy solves. Now we will prepare the server: serve the panel over HTTPS, connect a private GitHub repository, and configure private GHCR access. We will also configure email notifications from the panel itself.

The application comes in the next part. For now, keep three independent permissions separate: Git access, container registry access, and access to the Dokploy API.

Server and domains

The lab uses a dedicated VM with Ubuntu Server 24.04.5 LTS, 4 vCPUs, 8 GB of RAM, and a 60 GB disk. This is our lab configuration, not the platform's minimum requirement. Size a working server for its applications, data, and builds.

The examples use panel.example.com for the panel and app.example.com for the application. Replace them with your own names. A records point to the public IPv4 address of the server or router. Add AAAA only when IPv6 really delivers requests to the intended Traefik instance.

TCP ports 80 and 443 must be reachable from outside. Port 80 is also used for Let's Encrypt HTTP-01; it is not just a redirect endpoint. Behind NAT, forward both ports to the VM. Keep SSH accessible to administrators and port 3000 accessible only from a trusted network during initial setup. This single-node example does not require exposing internal Swarm ports to the internet.

A wildcard DNS record, such as *.example.com, can coexist with ordinary certificates for individual hostnames obtained through HTTP-01. A wildcard DNS record and a wildcard certificate are different things; the latter would require DNS-01.

Install a specific release

Use a dedicated machine for the experiment. The installer configures Swarm, so do not run it over an existing cluster with working services.

For a repeatable setup, use the installer supplied with a specific release:

curl -fsSL https://github.com/Dokploy/dokploy/releases/download/v0.31.4/install.sh \
  -o install-dokploy.sh
less install-dokploy.sh
sudo env ADVERTISE_ADDR=192.0.2.10 bash install-dokploy.sh

192.0.2.10 is a placeholder: replace it with the VM's interface address on its own network. Behind NAT, this is not the router's public address. For another version, use that release's installer asset; the latest shared installer combined with an older version variable may follow an incompatible setup procedure.

Our lab runs Dokploy v0.31.4, Docker Engine 28.5.0, and Traefik v3.7.19. Check the result:

sudo docker service ls
sudo docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}'

The panel and PostgreSQL run as Swarm services; Traefik is a separate container. Our application will be an ordinary Compose project.

Open http://<VM_IP>:3000, create the administrator, and save the password in a password manager. Do not leave initial administrator registration accessible to strangers.

Serve the panel over HTTPS

Under Settings → Web Server, enter Domain and Let's Encrypt Email, enable HTTPS, and save. Traefik routes the domain to http://dokploy:3000. TLS ends at the proxy; the remaining connection stays on the Docker network.

Check from an external machine:

curl -I http://panel.example.com
curl -I https://panel.example.com

HTTPS must validate without -k. If HTTP does not redirect yet, check the Traefik web entrypoint. The lab redirects web to websecure and uses a resolver named letsencrypt.

Before editing /etc/dokploy/traefik/traefik.yml, save a copy and inspect the existing sections. We need the Docker provider with exposedByDefault: false, dokploy-network, the file provider for /etc/dokploy/traefik/dynamic, and a Let's Encrypt resolver. Do not replace the whole configuration with a short example: that can remove the panel's routes and other settings.

Once the domain works, access the panel through it and choose Web Server → Server → Disable Port 3000. This removes the host port publication while keeping the panel's internal backend. If recovery is necessary, the command is:

sudo docker service update \
  --publish-add published=3000,target=3000,mode=host dokploy

Do not run it during normal operation.

Connect private Git through a GitHub App

Open Settings → Git → Github. Choose an organization or personal account, enter a unique name, and click Create Github App. Back in Dokploy, click Install, then select Only select repositories in GitHub.

In our design, Dokploy only needs dokploy-dotnet-deploy, which contains Compose. GitHub Actions obtains the source from dokploy-dotnet-demo; the panel does not need access to it.

Read the actual permissions before installation. The integration used here requests read access to code/metadata and write access to pull requests. The latter supports integration features, but our Compose example does not create PRs. For an existing App, add the new repository under Repository access and save.

Back in the panel, test the connection and check that the repository appears in the list. Select branch master and Compose Path ./docker-compose.yml. The App merely existing in GitHub does not prove that its installation can access a particular repository.

Complete the manifest flow through the same sequence of redirects. If a lengthy GitHub confirmation loses state, check whether the App was already created and deliberately restart the connection from Dokploy. Repeatedly creating more Apps is not a useful recovery strategy.

Connected GitHub provider

Email from the panel

Under Settings → Notifications, add Email and enter a name, SMTP server, port, username, password, From Address, and To Address. Select the events you actually want, such as failed deployments.

Use the SMTP provider's parameters. Submission commonly uses port 587 with STARTTLS; port 465 usually means TLS from the start. These modes are not interchangeable. Check the options in your Dokploy version and the provider's requirements, including app passwords or supported SMTP AUTH methods. Put the password in the protected field, not in Compose or Git.

The SMTP account must be allowed to use the From address. An arbitrary sender label does not authorize sending as another mailbox. If SMTP accepts the message but the recipient cannot find it, check spam, provider logs, and domain policy rather than relying only on a success message in the panel.

After saving, use the notification test and confirm receipt at the destination. Dokploy's SMTP settings serve its notifications; the .NET application in the next part does not inherit them.

Email notifications through Microsoft 365 on port 587; personal fields redacted

The lab verified submission through Microsoft 365 on port 587: the Dokploy test succeeded and the recipient confirmed delivery.

Private GHCR images

GitHub Packages visibility and package access are configured separately from GitHub App repository access. In part three, Actions will publish ghcr.io/leschenko-by/dokploy-dotnet-demo:v1.0.0 using GITHUB_TOKEN with packages: write.

The server needs a separate credential. Create a personal access token (classic) with read:packages, a limited lifetime, and an account that can access the package. Do not add repo, write:packages, or delete:packages just to pull images. If the organization requires SSO, authorize the token for it. A classic PAT cannot be restricted to one package: its reach also depends on the account's access. For stricter separation, use a dedicated technical account with limited access.

Under Settings → Registry, add:

Registry Name: GHCR demo pull
Username: <GitHub account that owns the token>
Password: <classic PAT with read:packages>
Registry URL: ghcr.io

In this version, Registry URL is a hostname, without https:// or an image path. The full image name belongs in Compose. Dokploy manages the credentials on the server, where they can serve multiple applications; they are separate from an APP_SECRET inside a container.

After publishing the first image, verify an authenticated pull and an anonymous denial. One successful pull alone does not establish privacy: the machine may already have stored credentials or image layers.

Connected GHCR registry

The panel is ready. Next, we will create the application, workflow, and Compose configuration, then release two versions without pressing Deploy manually.

Sources

Only registered users can leave a comment.

Sign in or register to leave a comment.