
June 2026
I spent years deploying applications on platforms like Heroku, Railway, and Render. They’re great — until your bill hits a point where a $5 VPS would do the same job. Self-hosting has always been the economic answer, but the ergonomic gap is real. You trade one-click deploys for SSH sessions, manual Dockerfiles, and duct-taped monitoring.
Dequel is my attempt to close that gap.
This post covers the origin of the project and the reasoning behind every major technology choice. It’s the first in a series tracking the build from conception to production.
The Problem
Self-hosted deployment in 2026 has options, but none of them clicked for what I wanted:
- Dokku is the closest spiritual ancestor — Docker-powered, Heroku-inspired, runs on a single server. But it’s tied to a specific git workflow, the plugin system shows its age, and there’s no built-in observability.
- CapRover simplifies things further but the UI is dated and the architecture fights you on anything non-trivial.
- Coolify is impressive and closest to what I wanted, but I had specific ideas about the tech stack and architecture that didn’t align.
What I wanted was a platform that felt like a modern SaaS — clean UI, auto-SSL, one-command install, built-in metrics and logs — but ran on my own hardware. No per-seat pricing, no egress fees, no vendor lock-in.
Design Constraints
Before writing a line of code, I set three hard constraints:
- Single VPS target. Multi-server orchestration (Kubernetes, Nomad) is a different problem with different complexity. The first version should excel at what fits on one machine (I have plans to add this to later versions though).
- Zero infrastructure toil. Install should be one command. No DNS setup, no database provisioning, no config file editing.
- Batteries included. Deploy, monitor, log, scale, alert — all shipping in the first release. No bolt-on observability later.
These constraints drove every subsequent decision.
Stack Decisions
Bun over Node.js
The runtime choice was the first fork in the road. Node.js is the safe bet, but Bun offered a compelling convergence:
- Built-in SQLite driver. No
better-sqlite3native compilation, nosql.jswasm overhead. Justimport { Database } from "bun:sqlite". - Built-in test runner. No Jest, no Vitest, no Mocha. One less dependency, one less config file.
- Native TypeScript. No
tsx, nots-node, no compile step. Run.tsfiles directly.
The tradeoff is ecosystem maturity. Some npm packages have edge cases on Bun. Express middleware that relies on Node API internals can break. I mitigated this by choosing ElysiaJS (more on that below) which is built for Bun from the ground up.
For a self-hosted single-server platform, Bun’s startup speed and lower memory profile also matter. Every millisecond of cold start and every MB of RSS adds up when you’re on a $10 VPS.
ElysiaJS over Express / Fastify
Given Bun, the framework choice narrowed. Express works but feels like bringing a 2010s tool to a 2020s project. Fastify has Bun compatibility issues in some plugin paths.
ElysiaJS is built specifically for Bun, offers first-class TypeScript inference (schema-driven type generation from endpoints), and includes built-in validation via the same schemas. The performance is competitive with Fastify.
The real win is the type system. Elysia infers request and response types from route definitions, eliminating the manual type duplication that plagues Express projects. For an API with dozens of endpoints managing deployments, databases, domains, and users, this catches real bugs at compile time.
Tradeoff: smaller community, fewer plugins. But the core needs (CORS, authentication, metrics) are covered, and the API surface is clean enough that building middleware is straightforward.
SQLite with an Eye on PostgreSQL
SQLite on a deployment platform sounds wrong. Deploy platforms manage data. Managed databases are a core feature. Shouldn’t the platform itself use PostgreSQL?
Yes — eventually. But for v0.1, SQLite wins on three axes:
- Zero operations. No Postgres container to manage, no connection pooling, no replication config. The database is a file in
./data/. - Backup simplicity.
cp data/dequel.db data/dequel.db.bak. That’s it. - Single-server honesty. If Dequel runs on one machine, SQLite handles the workload. The platform’s internal state (projects, deployments, env vars) is not high-throughput.
The schema is defined through Drizzle ORM, and the data access layer is abstracted behind repository functions. When multi-server support arrives, swapping SQLite for PostgreSQL means changing the Drizzle driver and the connection string. The queries don’t change.
Railway’s “volumes are not databases” warning applies here too. SQLite on networked storage will corrupt. The data/ directory is a local bind mount — not NFS, not EBS.
Caddy over Traefik / nginx
Reverse proxy choice is surprisingly consequential for a deployment platform. Three options, different tradeoffs:
- nginx is the default for a reason, but dynamic configuration means writing config files and reloading. Lua scripting or
ngx_http_lua_moduleadds complexity. - Traefik is designed for dynamic configuration and has native Docker discovery. But its configuration model is complex, and the automatic redirect behavior has burned me before.
- Caddy sits in the middle: simpler than Traefik, more dynamic than nginx. The killer features are automatic Let’s Encrypt SSL (zero config, just set a domain) and the
importdirective for file-based dynamic routing.
The architecture is simple: when Dequel creates a deployment, the API writes a Caddy route file to /etc/caddy/routes/<deployment-id>.caddy. Caddy’s import directive picks it up without a reload. When the deployment is removed, the file is deleted.
This is the same pattern Railpack uses for build detection — convention over configuration, with filesystem events as the integration point.
For multi-server setups, Traefik is the planned migration path. But for single-server, Caddy is the right tool.
Railpack for Auto-Detection
The killer feature of Railway (and Heroku before it) is zero-config deploys. Push code, get a running app. No Dockerfile required.
Railpack is Railway’s open-source build system, and it’s the piece that makes Dequel work. It detects the project type (Node, Python, Go, Rust, etc.), generates a Dockerfile, and builds with BuildKit. The detection logic is heuristic-based — presence of package.json, pyproject.toml, go.mod, etc.
The tradeoff is control. Railpack makes assumptions about your project structure. If your app has a non-standard entry point or needs custom build steps, you need a Dockerfile or a railpack.json override. Dequel falls back to Docker Compose for fully-custom setups.
Under the hood, Railpack talks to a BuildKit daemon running in a separate container. The API orchestrates the build, streams logs to the deployment record, and on success, starts the resulting image on the dequel_net network.
Docker Compose over Kubernetes
This was the easiest decision.
Kubernetes is the right answer for multi-server, multi-team, high-availability deployments. It’s the wrong answer for a single-VPS platform you install with one command.
Docker Compose gives us:
- Declarative service definitions
- Named networks with DNS resolution
- Volume management
- A single command to start everything
The entire platform runs as 11 Compose services. Users install with curl ... | sh, which downloads the compose file and pulls images. Updating is docker compose pull && docker compose up -d.
The deployment containers use the same Docker Engine API (mounted socket) that Compose itself uses. The API starts a container with the built image, connects it to dequel_net, and writes a Caddy route pointing to it.
PAM Auth over Database Users
Authentication was a philosophical choice. Most platforms implement their own user system — signup, password hashing, session management. For a self-hosted tool, this feels wrong. The server already has users. Why duplicate that?
PAM (Pluggable Authentication Modules) authenticates against the host system’s user database. If you’re on the server, you can log in. Dequel additionally requires membership in the dequel group.
The implementation uses a Python sidecar (pam-auth) that exposes a single POST endpoint. It calls libpam via ctypes — no HTTP libraries to install, no complex setup. The API container talks to the sidecar over the Docker network.
The benefit is zero user management infrastructure. Add a user to the dequel group on the host, and they have access. Remove them, and they don’t.
The tradeoff is Linux-only (PAM is not available on macOS or Windows) and host-dependent (no LDAP or SSO without additional PAM modules). LDAP integration is planned via pam_ldap.
TanStack on the Frontend
The frontend stack — React 18, Vite, TanStack Router, TanStack Query, Tailwind CSS — is conventional for a 2026 React project. The choices worth calling out:
- TanStack Router over Next.js or Remix. Dequel’s frontend is a dashboard, not a content site. There’s no SSR benefit, and the SPA model simplifies deployment (static files served by Caddy). TanStack Router provides type-safe routing, which catches URL parameter mismatches at compile time.
- TanStack Query for server state. The API client wrapper returns query keys and mutation hooks. Every page component uses
useQueryanduseMutation— no manual loading/error state management, no caching logic. ThestaleTimeis set globally to 2 seconds, which means the dashboard feels reactive without polling on every keystroke. - Radix UI primitives for accessibility. Dialog, dropdown, select, tabs — all from Radix, with Tailwind styling via
class-variance-authority. Building accessible dialogs from scratch is tedious and error-prone. Radix handles focus trapping, keyboard navigation, and ARIA attributes.
Observability from Day One
Most platforms add monitoring as an afterthought. It shows. Grafana dashboards get configured months after launch, log aggregation is a third-party service, and alerting requires another integration.
Dequel ships with cAdvisor, Prometheus, Loki, Promtail, and Grafana in the initial docker-compose.yml. The Grafana instance comes with pre-provisioned datasources (Prometheus and Loki) and a pre-built dashboard showing per-deployment CPU, memory, and request metrics. Alerts are defined in Prometheus for CPU and memory thresholds.
This increases the initial compose file size and pulls more images on install. But the alternative — “we’ll add monitoring later” — never happens, or happens wrong.
What This Post Didn’t Cover
There are design decisions I haven’t touched here: the database schema design (Drizzle ORM, migration strategy, the raw SQL holdouts in repo.ts), the async job queue (Redis + ioredis, why not Bull/BullMQ), the scaling engine (CPU-threshold based, why not predictive), and the deployment pipeline (Git clone, detect, build, start, health check, route).
Those will be their own posts.
Up Next
The next post covers the database schema design and migration strategy — why Drizzle, how the tables are organized, where raw SQL still wins over ORM, and the future PostgreSQL migration path.
---
This is part of a series about building Dequel, a self-hosted deployment platform. Code is at github.com/Lftobs/dequel.