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
| Path | Purpose |
|---|---|
/var/www/html | OpenEMR application root |
/var/www/html/sites/default/sqlconf.php | Database connection settings |
/var/www/html/sites/default/documents | Patient documents (blocked from web access) |
/opt/openemr-default-credentials.txt | Rotated Administrator credentials (mode 600) |
/etc/apache2/sites-available/openemr.conf | Apache virtual host (HTTP redirect + HTTPS) |
/etc/ssl/certs/openemr.crt | Per-instance TLS certificate |
/etc/ssl/private/openemr.key | Per-instance TLS private key |
/usr/local/bin/change-password.php | Administrator 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. That password is generated for your instance at first boot (instances launched before November 2026 kept a build-time password shared by every instance; see the note below). From the shell, the simplest route is the root socket login:
sudo mysql openemr
Older instances: give the database its own password
Instances launched before November 2026 still use the build-time openemruser password, the same on every instance. The database only listens on localhost, but give yours its own password anyway. This sets a random one in MariaDB and in sqlconf.php, then checks that it works:
NEW=$(openssl rand -hex 24)
sudo mysql -e "ALTER USER 'openemruser'@'localhost' IDENTIFIED BY '$NEW';"
sudo sed -i "s/^\$pass[[:space:]]*=.*;/\$pass\t= '$NEW';/" /var/www/html/sites/default/sqlconf.php
sudo mysql -u openemruser -p"$NEW" -e 'SELECT 1' openemr && echo "OpenEMR database password changed"
OpenEMR reads sqlconf.php on every request, so no restart is needed.
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
- 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 Apache vhost redirects HTTP to HTTPS using whatever hostname the client asked for, so no vhost change is needed for basic access.
- 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.4’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, so no configuration is needed unless you use C-CDA exports.
Next steps
- Tips & tricks: backups, updates, hardening and troubleshooting