Names and paths in the examples below are illustrative.
In part three, we deployed one container. Applications vary, though, and can be considerably more complex than Hello World: several services, a database, a message queue, and a cache may all become part of the system. More components also bring more deployment questions.
The following details come from setting up one of my pet projects on Dokploy 0.31.4. We will start with an option for separating supporting infrastructure from the application, then look at networking, configuration, and updates.
In the previous part, we prepared the panel, GitHub access, and a private registry. Now we will connect them: a new tag in the application repository triggers checks, an image build, and deployment through the Dokploy API.
A small website is enough. It displays its version and whether a secret setting exists; /health returns the same information as JSON. All application messages are English. A database would distract from the deployment process here.
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.
Dokploy is a platform for deploying containerized applications on your own servers. It brings Git, registries, configuration, HTTPS, and deployments into a web interface; server maintenance and recovery remain the team's responsibility.
In the article on running WireGuard on Ubuntu, a laptop and a phone connected to a VPN server. This time there’s an entire office at each end of the tunnel. A workstation in Office A can reach a service in Office B without running WireGuard itself. Two Linux routers handle the tunnel.
We’ll use the same setup to route selected external networks through Office B’s internet connection and give employees on Office A’s VPN access to those networks. Both offices can initiate connections to the other office’s LAN and VPN pool. The selected external networks are reachable through B, so there’s no corresponding route through A.
Before execve(), the runtime creates namespaces with clone(), moves the process into a cgroup, switches roots with pivot_root(), mounts /proc, /sys, and /dev, drops capabilities, and installs seccomp. It fits in 400 lines of C using only libc. A pipe lets the parent set up ID mappings, cgroup membership, and networking before the child proceeds. strace shows the resulting system calls.
Linux splits root privileges into capabilities. The runc template keeps three and nerdctl keeps fourteen, and neither set includes the capability needed for ordinary mounts. seccomp can reject a system call or kill the process with SIGSYS. A user namespace maps container root to an ordinary host user. On Ubuntu, unprivileged creation of user namespaces requires an AppArmor profile that permits it.
A veth pair links the container’s eth0 to a bridge on the host, and the container uses the bridge address as its default gateway. Forwarding and MASQUERADE provide outbound access. DNAT publishes ports, and DNS needs an upstream server reachable from the container’s own network namespace. These are the jobs of the CNI bridge and portmap plugins.
In cgroup v2, directories under /sys/fs/cgroup are groups, and their files expose settings and counters. Write a PID to cgroup.procs to move it into a group. Memory, CPU, process count, and I/O limits are controlled by memory.max, cpu.max, pids.max, and io.max. The same files back the groups runc and systemd create.
An OCI image is a set of files named by SHA-256 digest. The index points to a platform manifest, which points to the configuration and layer archives. OverlayFS stacks the extracted layers and adds a writable layer. Modified files are copied up and deleted files hidden by whiteouts. containerd’s snapshotter reuses the layer stacks by chainID.