This guide covers the layout and day-two configuration of the CloudSOE OpenMRS image on both AWS and Azure. It assumes you’ve finished one of the getting-started guides (AWS, Azure).
How the image is put together
Unlike our Apache-based images, OpenMRS 3 runs as the official Docker Compose deployment: a gateway container on port 80 in front of the O3 frontend, the OpenMRS backend and a MariaDB database (the db container, using the image pinned in the release’s compose file; sudo docker compose config --images shows it). nginx on the host terminates HTTPS on port 443 and proxies to the gateway. The heavyweight database initialization was done at build time; first boot only rotated credentials and started the stack.
File locations
| Path | Purpose |
|---|---|
/opt/openmrs | Compose project directory |
/opt/openmrs/docker-compose.yml | The stack definition, pinned to the release that shipped in the image |
/opt/openmrs/.env | Release tag plus the rotated database passwords (root-only, mode 600) |
/opt/openmrs/default-openmrs-credentials.txt | Rotated admin credentials (mode 600) |
/etc/nginx/sites-available/openmrs-https.conf | nginx HTTPS site (port 443, proxies to the gateway) |
/etc/ssl/certs/openmrs-selfsigned.crt | Per-instance self-signed certificate (generated on first boot) |
/etc/ssl/private/openmrs-selfsigned.key | Its private key (mode 600) |
/usr/local/bin/openmrs-bootstrap-status | Live first-boot progress meter (safe to run any time) |
Application data (the database and the OpenMRS data directory) lives in Docker named volumes, not in these paths.
Managing the stack
All the usual compose commands work from the project directory:
cd /opt/openmrs
sudo docker compose ps # status of gateway, frontend, backend, db
sudo docker compose logs -f # follow all logs (Ctrl+C to stop)
sudo docker compose restart # restart the stack
The stack is started by the one-time openmrs-firstboot service; after its marker file (/var/lib/openmrs-firstboot.done) exists, the containers are managed by Docker’s restart handling like any compose project.
Database access
MariaDB runs inside the db container. Both database passwords were rotated on first boot and live in /opt/openmrs/.env:
cd /opt/openmrs
DB_PASS=$(sudo grep '^OMRS_DB_PASSWORD=' .env | cut -d= -f2)
sudo docker compose exec db mysql -uopenmrs -p"$DB_PASS" openmrs
The backend reads its connection settings from openmrs-runtime.properties inside the openmrs-data volume. First boot keeps it in sync with the rotated password, so you shouldn’t need to touch it.
HTTPS and certificates
HTTPS is on by default: nginx on the host listens on port 443 (TLS 1.2 and 1.3) and proxies to the gateway on 127.0.0.1:80. On first boot the instance generates its own self-signed certificate for its public IP (/etc/ssl/certs/openmrs-selfsigned.crt with key /etc/ssl/private/openmrs-selfsigned.key), so HTTPS works immediately, but browsers will warn until you install a trusted certificate.
The gateway still answers plain HTTP on port 80; it is not redirected to HTTPS. Keep port 80 closed in your security group / NSG unless you need it.
To use a trusted certificate:
- Your own certificate on the instance: obtain a certificate for your domain (for example from Let’s Encrypt or your own CA), replace the two files named in
/etc/nginx/sites-available/openmrs-https.conf(always update both together), thensudo systemctl reload nginx. - Cloud load balancer: an AWS Application Load Balancer or Azure Application Gateway with a managed certificate, forwarding to port 443 on the instance. TLS certificates and renewal at the edge are handled for you.
The gateway must stay published on port 80, because nginx proxies to it there.
Pointing a domain at your system
Create an A record for your domain pointing at the instance’s public IP (on AWS, allocate an Elastic IP first so the address survives stop/start; on Azure, set the public IP to Static). The O3 frontend uses relative URLs, so no application-side URL change is needed for basic access.
REST and FHIR APIs
The backend exposes the standard OpenMRS APIs through nginx and the gateway, authenticated with the same admin account:
curl -k -u admin:<password> https://<public-ip>/openmrs/ws/rest/v1/session
curl -k -u admin:<password> https://<public-ip>/openmrs/ws/fhir2/R4/Patient
Next steps
- Tips & tricks: backups, updates, resource sizing and troubleshooting