Skip to content

Installation and deployment

Michael Yingbull edited this page Sep 30, 2026 · 8 revisions

Install CARLOS on an Ubuntu server

Home / Technical documentation / Running CARLOS

The Debian packages are the server installation described in the CARLOS README. They install the application, MariaDB, an nginx front door with a web application firewall, HTTPS, scheduled backups, the eForm PDF renderer, and the carlos-ctl administration command on one Ubuntu machine. This guide follows a new, empty installation. If you are moving an OSCAR19 clinic, prepare the target with this guide, then follow Migrate from OSCAR19 before first sign-in or adding clinic data. The importer requires an unused target with no demonstration data. For other transfers, see Data import and export.

Keep the release's package installation guide beside this page. It has the exact asset names, installer dialogs, and release-specific exceptions. The developer container and the Podman deployment mentioned in the README have different setup instructions. Commands below run in a terminal on the new server unless a step says otherwise. Replace VERSION_FROM_ASSETS with the application's exact Debian asset version and CTL_VERSION_FROM_ASSETS with the independently versioned CLI asset supplied on the same release page.

On this page: prepare the host · check the downloads · install · verify · first sign-in · backups and TLS · resolve a failure

Before you download

Use a dedicated Ubuntu 26.04 LTS server or VM with an amd64 (x86-64) processor, an account allowed to run sudo, and enough space for the database, documents, and backups. Requirements and compatibility explains the sizing and network checks. Record the name staff will use to reach CARLOS, how they will reach it over HTTPS, whether the server is for evaluation or clinic use, and the billing province. The billing province selects the database structure at first install and cannot be changed in place later.

Check the basics on the intended host:

cat /etc/os-release
dpkg --print-architecture
free -h
df -h /var

Confirm that the output shows Ubuntu 26.04 and amd64, and that memory and free space meet the starting requirements. Check that the Ubuntu universe component is enabled and package lists are current. The packaged Tomcat libraries and ModSecurity dependencies come from universe; the separate Ubuntu tomcat11 service package is not part of this installation. CARLOS starts its own private Tomcat service, and the packages refuse to install alongside tomcat11 rather than expose a second web server.

Arrange DNS and firewall access before installation. Staff need HTTPS on port 443, while the operator needs SSH access. A Let's Encrypt certificate needs a public DNS name and inbound port 80 during issuance and renewal. A self-signed certificate is available from the start if those are not ready. If users will connect from outside the practice network, use the server's DNS name rather than a public IP address; the packaged web application firewall expects that host name. Take a VM snapshot before installing on a prepared host.

SCREENSHOT NEEDED — OP-INSTALL-PREFLIGHT: Show a synthetic Ubuntu terminal with cat /etc/os-release, dpkg --print-architecture, free -h, and df -h /var plus their output. Keep the checks readable; hide the real host name and network details.

Download and check one release

Open the CARLOS release assets and choose one exact 2026.08 version. Download its .deb files and the matching .sha256 files into the same directory on the server. The package set below was checked against 2026.08.0-alpha18 on 2026-09-29; the package guide records earlier layouts and checksum exceptions. The usual package set is:

Package Why it is there
carlos-emr_<version>_amd64.deb The application, database setup, nginx and WAF, TLS, backups, migration manifests, and eForm PDF renderer. Required.
carlos-ctl_<ctl-version>_all.deb The administration and migration CLI. Required as a separate package from alpha16 onward.
carlos-emr-drugref_<version>_all.deb Drug and interaction lookups for prescribing. Install it if the clinic will prescribe in CARLOS.

The <version> is the Debian version in the asset filename, not simply 2026.08. For example, alpha18 uses 2026.08.0.alpha18. The application and DrugRef use that version; the CLI has its own version, such as 1.1.1, supplied on the same CARLOS release page. Through alpha15 the CLI was bundled inside carlos-emr. Alpha14 through alpha17 also supplied an empty transitional renderer package; alpha18 does not build it because the renderer is already inside the main package. Use the upgrade procedure when replacing an older installation.

From the download directory, verify each package you intend to install. Replace both version placeholders with the corresponding asset versions:

sha256sum -c carlos-emr_VERSION_FROM_ASSETS_amd64.deb.sha256
sha256sum -c carlos-ctl_CTL_VERSION_FROM_ASSETS_all.deb.sha256
sha256sum -c carlos-emr-drugref_VERSION_FROM_ASSETS_all.deb.sha256

Each check should report OK for its matching file. Stop if a checksum differs; check that the package and checksum came from the same release before downloading them again. Assets up to 2026.08.0-alpha12 have a filename mismatch inside their checksum files; the package guide explains how to compare them directly. The release process describes the published provenance attestations for operators who also verify where a build came from.

Install the packages together

Update the host's package lists, then install the files from the download directory in one apt command. Include only packages you downloaded and checked:

sudo apt update
sudo apt install --no-remove ./carlos-emr_VERSION_FROM_ASSETS_amd64.deb \
  ./carlos-ctl_CTL_VERSION_FROM_ASSETS_all.deb \
  ./carlos-emr-drugref_VERSION_FROM_ASSETS_all.deb

The ./ tells apt to use the local files. --no-remove makes apt stop instead of removing a companion package to satisfy a dependency. Read apt's proposed changes before accepting them. If you deliberately install without DrugRef because the site will not prescribe in CARLOS, omit its file and add --no-install-recommends; drug search will have no reference results. Do not install a stand-alone tomcat11 service or substitute a WAR file for this package procedure.

The installer asks for these settings. Pause at each prompt and check it against the site's recorded choices:

Installer question What the answer changes
Host name nginx's site name and the certificate subject. Use the name staff will enter in the browser.
Listen address 0.0.0.0 accepts connections on the server's interfaces; 127.0.0.1 is for local staging or a separate proxy.
Billing province on and bc install different schemas. other currently installs Ontario schema and billing settings. This choice cannot be changed in a populated database.
Java heap The installer suggests half of physical RAM, from 2g to 8g, on a fresh install. The database and operating system need memory too.
TLS mode Self-signed works immediately with a browser warning; ACME (Let's Encrypt) needs public DNS and port 80; manual mode uses a certificate and key supplied by the operator.
Let's Encrypt email Asked only for ACME. An empty answer skips requesting a certificate at install time.
Replace seeded administrator password Accept the default yes for a clinic installation. The replacement credentials go into a root-only file for the first sign-in.
Load fictitious demonstration data Leave the default no for a clinic system. The fake dataset is for an empty evaluation or development database and cannot be removed without destroying that database.

The installer then sets up the service accounts, database, configuration, certificate, and running services. The web application can take about two minutes to deploy. Apt may print a notice that a local .deb was read “unsandboxed as root” because _apt could not enter your download directory; the package guide explains that notice. A successful apt exit is only the end of package installation, not the final application check.

SCREENSHOT NEEDED — OP-INSTALL-PROMPTS: Capture two labelled synthetic installer dialogs: the billing-province choice, where the database consequence matters, and the TLS-mode choice. Do not show credentials or real site names.

Check the running system

Run the package's health check first:

sudo carlos-ctl check
sudo systemctl status carlos-emr-render-browser
sudo carlos-ctl logs -n 200

Read every failed probe in check. It tests the application and supporting services, schema, network exposure, certificate, web application firewall, and DrugRef if installed. An initial backup-freshness warning needs another check after you set up and run the first backup below. The eForm render browser needs its own service check: it turns saved eForms into PDFs and has a separate journal. In the application log, look for eForm browser renderer startup check passed. Press q to leave the service-status display. If the server was just restarted, allow the web application time to deploy before treating an early 502 response as a permanent failure.

Open https://<your-host>/ from a staff-accessible browser. Confirm the sign-in page loads through HTTPS and that the browser reaches the intended host name. A browser warning is expected for the initial self-signed certificate; replace it with a certificate trusted by the clinic's browsers before routine use. A command-line health check cannot prove that staff can sign in or use the application.

SCREENSHOT NEEDED — OP-INSTALL-CHECK: Show a redacted successful sudo carlos-ctl check, active eForm render-browser service, and the matching fictional site's HTTPS sign-in page. Use separate crops if the text would be unreadable in one image.

Secure the first account

Migrating from OSCAR19? Complete backup setup below, then follow Migrate from OSCAR19 before signing in. The importer creates a separate emergency administrator and removes the seeded carlosdoc account. The first-account steps in this section apply to a new clinic starting with an empty database.

If the installer replaced the seeded administrator password, read the generated credentials on the server with sudo cat /etc/carlos-emr/initial-admin.txt. Keep the terminal private and do not copy those credentials into a ticket or screenshot. Sign in as the seeded administrator, complete its forced password reset, create named administrator and staff accounts, then disable the seeded account and remove the one-time credentials file. Accounts, roles, and access covers the application settings.

SCREENSHOT NEEDED — OP-INSTALL-FIRST-LOGIN: Show the fictional site's first sign-in and forced password-reset screen as separate images. Keep all password and PIN fields empty, hide the generated credentials, and make the account context and page titles readable.

Set up backups and the certificate

The default restic repository—the place encrypted backups are written—is on the server. It is useful as a local first tier, but it cannot recover the clinic if that machine and its storage are lost. Point RESTIC_REPOSITORY in the protected /etc/carlos-emr/backup.env to a different machine or storage service, keep a separate copy of RESTIC_PASSWORD away from the server, and configure a backup-failure alert. The application encryption key also needs a separate protected copy; Backups and recovery names its file and explains why it matters. Then run:

sudo carlos-ctl backup full
sudo carlos-ctl backup verify
sudo carlos-ctl backup status

backup verify restores the newest database dump into a scratch database; it does not replace a rehearsal of the full recovery procedure. Run sudo carlos-ctl check again after this setup and investigate any remaining backup warning. Backups and recovery explains what to keep and what to test. If the site will use Let's Encrypt and its public DNS and port 80 are ready, sudo carlos-ctl cert acme <email> can request a trusted certificate. Otherwise arrange a trusted manual certificate or record how browser trust will be managed. Check the result with sudo carlos-ctl cert status and a real browser connection.

If a check fails

Do not retry the whole installation blindly. Keep the exact error and time, then use the failed check to choose the next place to look:

What you see First check
Apt returned, but check says provisioning never finished or the database has no tables Run sudo carlos-ctl finish-install and read its result; check journalctl -u mariadb if the database step failed.
Application stopped after a seeded-password replacement failure The package keeps it disabled rather than expose the known password. Read the install log and use sudo carlos-ctl finish-install after correcting the cause.
Browser cannot connect Check sudo journalctl -u nginx -n 50 and confirm the listen address and firewall route.
502 just after installation Follow sudo carlos-ctl logs -f while the web application deploys.
Generated administrator credentials are rejected Read the root-only credentials file again rather than using a development password. The PIN must be exactly four digits.
eForm PDF fails but application logs show little Check sudo journalctl -u carlos-emr-render-browser -n 50.
Drug search is empty Check whether the matching DrugRef package was installed, then read the DrugRef probe in sudo carlos-ctl check.
A page fails without an application error Check sudo carlos-ctl waf tail for a blocked request.

The package troubleshooting table has the longer diagnostic paths. For an installation that is already serving a clinic, coordinate interruptions and recovery through Monitoring and troubleshooting.

Hand over the installation

Record the exact installed package versions, site name, billing province, certificate method, backup destination and verification result, administrator handoff, and any checks still open. Show the clinic contact how to find help and have an authorized person confirm sign-in and an appropriate task in the intended environment. Use fictional records only in an evaluation or test installation. The installed operator manual at /usr/share/doc/carlos-emr/README.Debian, also available in the source, man carlos-ctl, and the administration command reference are the next references for whoever maintains the server.

Related pages

Requirements and compatibility · Backups and recovery · Server security · Server configuration reference

CARLOS documentation

All topics · Get help

Using CARLOS

Start here · Clinic workflows

Getting started and everyday reference
Office staff
Clinical staff and doctors
Clinic managers and administrators

Technical documentation

Technical overview · Reference

Running CARLOS

Install and configure
Maintain and troubleshoot

Developing CARLOS

Code, interfaces, and tests
Contribute and maintain releases

For everyone

Write and maintain the documentation

Clone this wiki locally