Deployment guide

GNU Health

Videos

Overview: GNU Health on Ubuntu 24.04 LTS on Azure (watch on YouTube)

Launch and log in: GNU Health on Ubuntu 24.04 LTS on Azure (watch on YouTube)

Deep dive: GNU Health on Ubuntu 24.04 LTS on Azure (watch on YouTube)

Overview

GNU Health is a free and libre Hospital and Health Information System (HIS/HMIS) and an official GNU project. Built on the mature Tryton application framework, it provides electronic medical records, patient and health-professional management, health institutions, appointments and clinical evaluations.

This SecureAnyCloud image ships the GNU Health HIS 5.0 core in a dedicated Python virtual environment on Tryton 7.0 LTS. gunicorn serves it behind nginx, with a PostgreSQL database and the Tryton sao web client ready in the browser. The image is secure by default: no database and no default login ship in the image at all.

On the first boot of every VM, the image initialises a fresh, empty GNU Health database, activates the health information system modules and creates the administrator account. The administrator password is unique, randomly generated and written to a root-only file.

What you get:

  • GNU Health HIS 5.0 core (the health Tryton module) on Tryton 7.0 LTS, installed in a dedicated Python virtual environment and running as the gnu-health gunicorn systemd service
  • The Tryton sao web client on :80, fronted by nginx. nginx serves the web client's static assets directly and proxies the application's remote-procedure calls. It is the only way in, because gunicorn is bound to loopback 127.0.0.1:8000 and never exposed directly.
  • A PostgreSQL 16 database holding the health information system, created fresh on first boot as a per-VM database
  • No default login and no shipped patient data: the administrator is created with a unique random password on first boot, never baked into the image
  • An application gated on a first-boot bootstrap marker, so it never starts before the fresh database and per-VM credential exist
  • An unauthenticated /healthz endpoint for Azure Load Balancer health probes
  • A 4 GiB swap file so the system runs comfortably on a small instance
  • postgresql.service, gnu-health.service (gunicorn/trytond) and nginx.service as enabled, active systemd units
  • 24/7 SecureAnyCloud support

Prerequisites

You need an active Azure subscription, an SSH key pair, and a VNet with a subnet in the target region.

Standard_B2s (2 vCPU / 4 GiB RAM) is a comfortable starting size.

Configure the network security group (NSG) to allow inbound 22/tcp from your management network and 80/tcp for the web client. Also allow 443/tcp if you add TLS. GNU Health serves plain HTTP on port 80, so for production, terminate TLS in front of it with your own domain and restrict access to trusted IP ranges (see Maintenance).

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for GNU Health by SecureAnyCloud, and select Create.

On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) and HTTP (80).

Select Review + create, then Create.

Step 2 - Deploy from the Azure CLI

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:gnu-health-ubuntu-24-04:default:latest
az vm create \
  --resource-group <your-rg> \
  --name gnu-health \
  --image sac1647283583153:gnu-health-ubuntu-24-04:default:latest \
  --size Standard_B2s \
  --admin-username azureuser \
  --generate-ssh-keys \
  --public-ip-sku Standard

Open port 80 so you can reach the web client:

az vm open-port --resource-group <your-rg> --name gnu-health --port 80

Step 3 - Connect to your VM

Connect over SSH:

ssh azureuser@<vm-public-ip>

Step 4 - Confirm the services are running

Check the three services:

systemctl is-active postgresql gnu-health nginx

All three report active. GNU Health runs under gunicorn on the loopback address 127.0.0.1:8000. nginx fronts it on port 80, and PostgreSQL is bound to loopback. The application is never bound to a public interface, so nginx is the only way in.

Step 5 - Retrieve your admin password

GNU Health signs in with a Tryton user. The username is admin. Your VM generates a unique password on first boot and writes it to a root-only file. Read the file with:

sudo cat /root/gnu-health-credentials.txt

The file contains GNUHEALTH_ADMIN_USER, GNUHEALTH_ADMIN_PASSWORD, the GNUHEALTH_DB database name to select at sign-in, and the GNUHEALTH_URL to open in a browser. Its mode is 0600 root:root. The image never creates a default account, so no shared or default credential exists.

Store the password somewhere safe and change it after your first sign-in (see Maintenance).

Step 6 - Confirm the health endpoint

nginx serves an unauthenticated health endpoint for load balancers and probes. Request it with:

curl -s http://localhost/healthz

The endpoint returns ok. It never requires authentication, so an Azure Load Balancer health probe can use it.

Step 7 - Confirm the web client and the end-to-end round trip

The Tryton web client is served on port 80, and the application server answers remote-procedure calls behind it. A helper on the image proves the full round trip end to end. It checks four things:

  • The web client answers.
  • The per-VM admin password authenticates through the running server.
  • The GNU Health module is active.
  • A health record can be created and read back.

Run the checks:

echo "web client: $(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1/)"
sudo bash /usr/local/sbin/gnu-health-verify-login.sh

The web client returns 200 and the proof prints OK. This means the sao client loads, the per-VM admin password authenticates, and the GNU Health health module is active. It also means a demonstration party record was created, read back and removed.

Step 8 - Confirm the installed version and the GNU Health module

GNU Health runs on the Tryton framework in a dedicated virtual environment. Confirm the framework version, the GNU Health version, and that the health module is activated in the database:

/opt/gnuhealth/his-50/venv/bin/python -c "import trytond; print('trytond', trytond.__version__)" /opt/gnuhealth/his-50/venv/bin/pip show gnuhealth | grep -E '^Name|^Version'

The output reports trytond 7.0.x and GNU Health 5.0.x. This confirms that the GNU Health HIS core is installed and activated, so the health information system is ready on first boot.

Step 9 - Sign in to the web client

Browse to http://<vm-public-ip>/. The Tryton web client loads. Click the sign-in icon and enter the database name (ghealth), the user name admin and the password from Step 5. This is the browser interface to your health information system.

Step 10 - Explore the GNU Health desktop

After you sign in, you land on the GNU Health desktop as the Administrator. Use the action search at the top left to open any view.

From here you reach the health information system menus: parties and patients, health professionals, institutions, appointments and evaluations, financial, and administration.

Step 11 - Work with parties and patients

Open Parties from the action search. Parties are the people and organisations GNU Health manages. Patients, health professionals, insurers and institutions all build on the party record.

Open a party to see its demographics. Mark a person as a patient to create their clinical record.

Step 12 - Administration and users

Open Users from the action search under Administration. Here you manage the accounts that can sign in to your health information system, assign roles and groups, and add the clinicians and staff for your institution.

Step 13 - Build your health information system

The image ships a fresh, empty GNU Health database, so you start from a clean installation with no demonstration patient data.

Add your institution under the Health configuration, then create health professionals and patients as parties. Activate the optional GNU Health packages you need (laboratory, imaging, inpatient, nursing, pediatrics and many more) with the GNU Health tooling. See the GNU Health documentation for configuring and extending your deployment.

Maintenance

  • Password. The administrator password is generated on first boot and stored in /root/gnu-health-credentials.txt (mode 0600 root:root). Change it from the web client under the admin user's preferences. Alternatively, reset it from the command line by re-running trytond-admin against the ghealth database with a password file.
  • Custom domain or reverse proxy. Out of the box, you reach GNU Health directly on the public IP. If you front it with your own domain or an external reverse proxy, add that origin to the cors setting under [web] in /opt/gnuhealth/his-50/etc/trytond.conf, then run sudo systemctl restart gnu-health. This lets the web client accept browser requests from that origin.
  • Restrict access and add TLS. GNU Health serves plain HTTP on port 80. For production, restrict access to trusted IP ranges in your network security group, and front it with TLS (for example certbot with your own domain) terminating on :443.
  • Loopback binding. gunicorn is bound to 127.0.0.1:8000 in /etc/systemd/system/gnu-health.service, so nginx is the only path in. Keep it that way, and do not change the bind address to a public interface.
  • Database. The health information system lives in the ghealth PostgreSQL database on loopback. Back it up with sudo -u gnuhealth pg_dump ghealth > ghealth.sql. The gnuhealth role connects over the local socket with peer authentication, so no database password is stored on disk.
  • GNU Health packages and updates. Additional GNU Health modules install into the virtual environment with pip and activate with the Tryton trytond-admin tooling against the ghealth database. After changes, restart with sudo systemctl restart gnu-health.
  • Security patches. unattended-upgrades stays enabled, so the OS keeps receiving security updates automatically.

Support

SecureAnyCloud provides 24/7 expert support for this image. Contact sales@secureanycloud.com.

Deploy on Azure

Launch GNU Health on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure