Video summary

Why I'm no longer using Docker (on a VPS)

Main summary

Key takeaways

Technology

Why I Stopped Using Docker for My VPS Applications

After using Docker for over a decade, the creator explains why they stopped using it to deploy their own applications to VPS instances. The change followed a move to NixOS, where system and application configuration can be defined declaratively and deployed from a single configuration.

Why Docker Became Unnecessary

A typical Docker deployment involved building and tagging an image, pushing it to a container registry, updating the image reference in the NixOS configuration, and redeploying. The creator found this more cumbersome than using NixOS directly, which required updating the application’s commit in the configuration and redeploying.

The Docker approach also introduced external dependencies and potential failure points, including registry access, credentials, networking, and image availability. Because an image might only be fetched during activation, an invalid or inaccessible image could leave the system partly configured and the application stopped. This also weakened NixOS’s reproducibility: the configuration alone was not enough to recreate the system if an image was missing.

The NixOS Workflow

The creator’s NixOS configuration defines the system setup—including users, SSH hardening, packages, and services—and can be built locally and activated on a VPS.

Unlike tools that modify a running system step by step, NixOS attempts to build the new system before activating it. Failed builds therefore generally leave the VPS unchanged. NixOS also keeps prior system generations available for rollback.

The configuration is version-controlled and reused across the creator’s VPS fleet, bare-metal machines, and virtual machines. The creator describes it as the single source of truth for their infrastructure.

Bringing Docker Images Into Nix—and Then Removing Docker

The creator first considered Nix’s pullImage function, which fetches an image into the Nix store during the build. This would avoid pulling from a registry on the VPS, but still required a separate image-publishing workflow.

They then used Nix’s buildImage function. Rather than building from a Dockerfile or invoking Docker, it creates a Docker-compatible tarball using Nix. This required packaging each application with a Nix flake, which describes how to build the application and its dependencies. The application package could then be imported into the VPS configuration and used to build an image alongside the rest of the system.

This improved deployment by removing the need for a container registry and VPS-side registry credentials, and by ensuring build failures occurred before activation. But once the application was already being built as a Nix package, the creator realized they could run it directly as a systemd service, without building an image at all.

Isolation Without Docker

The creator still wanted service isolation, both to avoid conflicts and to limit potential damage if an application were compromised. They describe two NixOS options:

  • systemd sandboxing
  • NixOS containers: isolated NixOS environments that can have their own networking, filesystem, packages, firewall rules, and services. They also support features such as port forwarding, volume mounts, resource limits, and ephemeral operation.

To avoid repeating boilerplate, the creator built a reusable configuration interface for services. It lets them specify the package to run and options such as ports, secrets, environment variables, and ingress settings. Internal services can be exposed through Tailscale Serve, while external ones can use Cloudflare Tunnel.

Scope and Takeaway

The creator has not stopped using Docker altogether. They still use it for applications distributed as Docker images and for a home lab running K3s. Their conclusion is specific to deploying their own applications on VPS instances: NixOS provides the build, deployment, configuration, and isolation features they need without Docker.

Guide and Tutorial Information

  • The video demonstrates a NixOS VPS setup and deployment workflow, including configuring a machine, packaging an application with a Nix flake, building an image with Nix, and running an application as a systemd service or in a NixOS container.
  • The creator says their NixOS configuration and instructions are available on GitHub.

Main Speakers and Sources

  • Main speaker: Dreams of Code, presenting their own VPS deployment workflow and analysis.
  • Sponsor: Hostinger, mentioned in connection with NixOS VPS support and promotional pricing.

Rate this summary

Your feedback will help improve summaries.

Improve this summary

Reprocess with a stronger model when the summary feels incomplete or inaccurate.

Pro

Translate summary in another language

Pro

Ask questions to this video

Chat for follow-up questions, clarifications, and source-backed answers.

Coming soon

Share this summary

Original video