Anonymised case study based on real work. The business and its applications are not named; no figures are claimed beyond what the systems showed.

The situation

A growing digital business wanted a full backend for its web tools: a database, authentication, file storage, real-time updates and serverless functions. A hosted service was an option, but the business preferred to keep its data on its own server alongside its websites.

The approach

1. Run the open-source stack in containers. The platform was deployed as a set of containers: a PostgreSQL database, an authentication service, a REST API layer generated from the database schema, real-time messaging, object storage with an image transformation service, edge functions, a connection pooler, a metadata service and an administration studio, all behind an internal API gateway.

2. Put it behind the existing web server. The platform's gateway listens only on the server itself. The public web server terminates TLS for a dedicated subdomain and forwards traffic, so certificates and access rules live in one place.

3. Keep secrets out of code. Keys and passwords live in an environment file on the server, readable only by the administrator, and are recorded in the owner's private credential store rather than in repositories.

4. Include it in maintenance. The platform is part of the server's update routine and health checks, and its database is dumped by the backup script before archives are copied off the server.

The outcome

The business has a self-hosted backend running on the same server as its websites, reachable over TLS through its own subdomain, covered by routine updates and by verified backups.

Trade-offs to consider

FAQ

Is self-hosting cheaper than a hosted plan? It can be for small workloads, but include the time for maintenance in the comparison.

What must be backed up? The database, storage volumes and the configuration needed to recreate the stack.

I take on a small number of advisory and hands-on systems engagements each quarter. Connect at virender.in.