Self-Hosted Hospital System, Back in 2 Min After a Power Cut by Pratik PatilSelf-Hosted Hospital System, Back in 2 Min After a Power Cut by Pratik Patil

Self-Hosted Hospital System, Back in 2 Min After a Power Cut

Pratik Patil

Pratik Patil

The problem

A hospital needed one connected system in place of scattered registers and spreadsheets, and wanted sensitive patient data kept in-house instead of on third-party cloud hosting.

What I built

Clinical workflow screens: patient records, appointments, a visit pad that moves a patient from outpatient visit to inpatient admission, prescriptions, billing and discharge summaries
Print-ready PDFs for bills, prescriptions and discharge cards, with the hospital's letterhead and logo
Role-based access, plus per-hospital data isolation so one deployment can serve several hospitals
A mobile-friendly interface with dark mode, designed for non-technical staff
Self-hosting on an Ubuntu Linux server with Docker Compose and PostgreSQL, reached through a Cloudflare Tunnel so no router ports are opened
Automated backups every 4 hours, daily and weekly, copied off-site to Cloudflare R2, with a restore drill tested
Automatic recovery after a power cut: in a timed test the full app was back in about two minutes

Tech stack

Next.js, NestJS, PostgreSQL, Prisma, Docker Compose, Cloudflare Tunnel and R2, Ubuntu Server.

My role

Fullstack and DevOps engineer on a two-developer team. I built the clinical UI and PDFs, access control and data isolation, and the server, tunnel and backup setup.

Links

Private to the hospital. Client details are kept confidential.
Like this project

Posted Oct 26, 2026

A hospital management system for patient records, appointments, billing and discharge summaries, self-hosted on a private Linux server with PostgreSQL, secure Cloudflare Tunnel access and automated off-site backups. Client details are confidential.