Виталий Лещенко

Dokploy on Your Own Server. Part 4: Dokploy lessons from a real project

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.

Read more
Виталий Лещенко

Dokploy on Your Own Server. Part 3: Deploying a .NET application with GitHub Actions and Dokploy

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.

Two repositories, one release

Read more
Виталий Лещенко

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

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

Read more
Виталий Лещенко

WireGuard Site-to-Site: Connecting Offices, VPN Clients, and Selected Networks

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.

Two office networks connected by a WireGuard tunnel

Read more
Виталий Лещенко

Linux Containers by Hand. Part 8: Writing a container runtime in C

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.

Read more
Виталий Лещенко

Linux Containers by Hand. Part 7: Restricting root privileges in a container

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.

Read more
Виталий Лещенко

Linux Containers by Hand. Part 6: Connecting a container with veth, a bridge, and NAT

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.

Read more
Виталий Лещенко

Linux Containers by Hand. Part 5: Limiting process resources with cgroup v2

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.

Read more
Виталий Лещенко

Linux Containers by Hand. Part 4: Building a container root from image layers

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.

Read more