This guide covers the layout and day-two configuration of the CloudSOE OpenEMR image on both AWS and Azure. It assumes you’ve finished one of the getting-started guides (AWS, Azure).

File locations

PathPurpose
/var/www/htmlOpenEMR application root
/var/www/html/sites/default/sqlconf.phpDatabase connection settings
/var/www/html/sites/default/documentsPatient documents (blocked from web access)
/opt/openemr-default-credentials.txtRotated Administrator credentials (mode 600)
/etc/apache2/sites-available/openemr.confApache virtual host (HTTP redirect + HTTPS)
/etc/ssl/certs/openemr.crtPer-instance TLS certificate
/etc/ssl/private/openemr.keyPer-instance TLS private key
/usr/local/bin/change-password.phpAdministrator password reset helper

Services

Apache and MariaDB are managed by systemd and enabled at boot:

sudo systemctl status apache2 mariadb
sudo systemctl restart apache2      # after config changes

The one-time setup service openemr-firstboot only runs until it completes once; after that it exits immediately thanks to its marker file (/var/lib/openemr-firstboot.done).

Database access

OpenEMR uses a local MariaDB database named openemr, accessed as the openemruser database user. The connection settings — including the database password — live in /var/www/html/sites/default/sqlconf.php. From the shell, the simplest route is the root socket login:

sudo mysql openemr

Resetting the Administrator password

If you ever lose the Administrator password, the image ships a reset helper that writes a new hash directly to the database:

sudo php /usr/local/bin/change-password.php 'my-new-strong-password'

This is the same mechanism first boot uses to rotate the build-time password. Prefer changing passwords from within OpenEMR (Administration → Users) in normal operation.

Replacing the self-signed certificate

The image regenerates a self-signed certificate at first boot so HTTPS works immediately, but browsers won’t trust it. certbot is preinstalled; once your domain points at the instance, get a trusted certificate:

sudo apt install python3-certbot-apache
sudo certbot --apache -d emr.example.com

Alternatively, install a purchased certificate and key at /etc/ssl/certs/openemr.crt and /etc/ssl/private/openemr.key, then sudo systemctl reload apache2 — always replace both files together.

Pointing a domain at your system

  1. 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).
  2. The Apache vhost redirects HTTP to HTTPS using whatever hostname the client asked for, so no vhost change is needed for basic access.
  3. Set the correct site address in OpenEMR under Administration → Config → Appearance / Site Address so generated links and portal URLs use your domain.

PHP settings

OpenEMR’s recommended PHP settings ship as a drop-in for both Apache and the CLI. Adjust them there if needed (the PHP version directory matches the distro’s PHP):

PHPDIR=$(php -i | sed -n 's/^Scan this dir for additional .ini files => //p')
sudo nano "$PHPDIR/99-openemr.ini"
# max_execution_time = 60, memory_limit = 256M,
# post_max_size = 60M, upload_max_filesize = 60M, ...
sudo systemctl restart apache2

The C-CDA service

OpenEMR 8.0’s C-CDA generation runs on Node.js 22, preinstalled with its dependencies under /var/www/html/ccdaservice. It is started by OpenEMR on demand — no configuration needed unless you use C-CDA exports.

Next steps

  • Tips & tricks — backups, updates, hardening and troubleshooting