01.14 Installing on Ubuntu 26.04
Install SimpleRisk by hand on Ubuntu Server 26.04 LTS with Apache, MySQL, and PHP 8.5 — every command the scripted installer runs, laid out so you can run, review, or adapt each one.
Why this matters
Most people should use the installation script. It does everything on this page in one run, it's tested on every release, and it's the quickest way to a working instance. This article is for the cases where you can't or won't run a script as root on a production server: your change process wants to review each command, your hardening baseline already owns Apache or MySQL, or you're building an image and need to know exactly what goes into it.
The steps here follow the script's own order and settings, and they were run start to finish on a clean Ubuntu 26.04 LTS server for this release. If something here and the script ever disagree, the script wins, because it's the thing CI exercises.
One decision up front. The script installs PHP 8.5 from the Sury package repository on every Ubuntu and Debian release it supports, and this guide does the same. Ubuntu 26.04's own repositories carry PHP 8.5 as well. If your policy forbids third-party package repositories you may be able to use it instead, but this guide only walks the Sury path, so the Ubuntu-PHP route is yours to verify: skip Step 1, drop the 8.5 from the package names in Step 2, and point Step 3 at the php.ini for the version Ubuntu installs.
Before you start
- An Ubuntu Server 26.04 LTS machine with at least 2 GB of memory, a static address or a DNS name, and outbound internet access. Sizing guidance is in System Requirements.
- A user with
sudo. Every command below runs as root. If you're logged in as a normal user, start a root shell once withsudo -iand stay in it. - Ports 80 and 443 reachable from the people who'll use SimpleRisk. Step 8 opens them on the server's own firewall. Cloud security groups and network firewalls are yours to adjust.
- A hostname for the instance. Throughout this article, replace
{your-simplerisk-host}with your instance's hostname (for example,grc.example.com). It's a hostname only: nohttps://, no path. - A decision about the TLS certificate. The steps below leave Ubuntu's self-signed "snakeoil" certificate in place so the site comes up on HTTPS right away. Browsers will warn about it. Replace it before real users arrive, using HTTPS and TLS Configuration.
Step-by-step
1. Add the PHP repository
Install the tools needed to fetch and check the repository key.
apt-get update
apt-get install -y gnupg curl ca-certificates lsb-release
Download the repository's signing key and compare its fingerprint to the published one before you trust it.
mkdir -p /etc/apt/keyrings
curl -fsSL https://packages.sury.org/php/apt.gpg -o /etc/apt/keyrings/sury-php.gpg
gpg --no-default-keyring --keyring /etc/apt/keyrings/sury-php.gpg --fingerprint
The fingerprint must read 1505 8500 A023 5D97 F5D1 0063 B188 E2B6 95BD 4743. If it doesn't, stop and delete the file. Everything after this step installs software that this key vouches for.

echo "deb [signed-by=/etc/apt/keyrings/sury-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" \
> /etc/apt/sources.list.d/sury-php.list
apt-get update
2. Install Apache, MySQL, and PHP
apt-get install -y apache2 mysql-server \
php8.5 libapache2-mod-php8.5 php8.5-mysql php8.5-xml php8.5-mbstring \
php8.5-ldap php8.5-curl php8.5-gd php8.5-zip php8.5-intl php8.5-dev \
cron iputils-ping
phpenmod ldap
a2enmod rewrite ssl
a2ensite default-ssl
cron runs SimpleRisk's scheduled work in Step 7, and iputils-ping provides the ping command that asset discovery uses. The script also installs the PHP development headers (php8.5-dev), so this list does too. The ldap module is enabled whether or not you use directory sign-in, because SimpleRisk's requirements list it.
Check what you got. Check what you got. Ubuntu 26.04 supplies Apache 2.4 and MySQL 8.4, the long-term-support release System Requirements recommends for new deployments; PHP comes from the repository you added.
apache2 -v | head -1
mysql --version
php -v | head -1
php -m | grep -E '^(ldap|mysqli|mbstring|gd|curl|zip|intl|xml)$' | tr '\n' ' '

3. Set the PHP limits
The script sets a 5 MB upload limit, a 256 MB memory limit, and room for 3,000 input variables. The last one matters on pages that post many fields at once, because PHP drops any field past the limit.
sed -i 's/^\(upload_max_filesize =\).*/\1 5M/; s/^\(memory_limit =\).*/\1 256M/; s/^;\?\(max_input_vars =\).*/\1 3000/' \
/etc/php/8.5/apache2/php.ini
grep -E '^(upload_max_filesize|memory_limit|max_input_vars) =' /etc/php/8.5/apache2/php.ini
The grep should print the three values you just set. If one is missing, the file has a different layout than expected and you'll need to set it by hand.

4. Download SimpleRisk and verify it
SimpleRisk publishes the current version and the checksum of each download in one small file. Read the version and both checksums from it, download, and check.
RELEASES=$(curl -fsSL https://updates.simplerisk.com/releases.xml)
VERSION=$(printf '%s' "$RELEASES" | grep -oP '
\K[^<]+' | head -n1) DB_SHA=$(printf '%s' "$RELEASES" | sed -n '/
/,/<\/en>/p' | grep -oP '
\K[^<]+' | head -n1) echo "Installing SimpleRisk $VERSION"
Download the application bundle, check it, and unpack it into /var/www.
cd /var/www
wget "https://simplerisk-downloads.s3.amazonaws.com/public/bundles/simplerisk-${VERSION}.tgz"
echo "${BUNDLE_SHA} simplerisk-${VERSION}.tgz" | sha256sum -c -
tar -xzf "simplerisk-${VERSION}.tgz"
rm "simplerisk-${VERSION}.tgz"
sha256sum must print OK. If it prints FAILED, delete the file and start again; don't unpack it. Download the English database file the same way.
wget -O /var/www/simplerisk/database.sql \
"https://github.com/simplerisk/database/raw/master/simplerisk-en-${VERSION}.sql"
echo "${DB_SHA} /var/www/simplerisk/database.sql" | sha256sum -c -
Both checks print OK, with the version you downloaded in the first filename.

Create the configuration file from the sample, and give the web server's account ownership of the application directory. Name the group as well as the user. Ubuntu 26.04 ships the Rust rewrite of the core utilities, and its chown leaves the group as root when you write a bare www-data:. The site still works that way, but the explicit form gives the same ownership you'd get on every other release.
cp /var/www/simplerisk/includes/config.sample.php /var/www/simplerisk/includes/config.php
chown -R www-data:www-data /var/www/simplerisk
5. Create the database and connect SimpleRisk to it
The script sets MySQL's SQL mode to NO_ENGINE_SUBSTITUTION only, which drops the strict defaults. Match it: SimpleRisk is built and tested against that setting.
echo 'sql-mode="NO_ENGINE_SUBSTITUTION"' >> /etc/mysql/mysql.conf.d/mysqld.cnf
systemctl restart mysql
Ubuntu's MySQL lets root in over the local socket without a password, so mysql works as-is from your root shell. Create the database and a dedicated user with a generated password, import the schema, and grant the user the permissions SimpleRisk needs.
DBPASS=$(openssl rand -hex 24)
mysql -e "CREATE DATABASE simplerisk"
mysql -e "CREATE USER 'simplerisk'@'localhost' IDENTIFIED BY '${DBPASS}'"
mysql simplerisk < /var/www/simplerisk/database.sql
mysql -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER ON simplerisk.* TO 'simplerisk'@'localhost'"
Write the connection details into the configuration file, then delete the schema file, which has no further use.
sed -i "s/\(DB_HOSTNAME', '\)__DB_HOSTNAME__/\1127.0.0.1/; s/\(DB_PORT', '\)__DB_PORT__/\13306/; s/\(DB_USERNAME', '\)__DB_USERNAME__/\1simplerisk/; s/\(DB_PASSWORD', '\)__DB_PASSWORD__/\1${DBPASS}/; s/\(DB_DATABASE', '\)__DB_DATABASE__/\1simplerisk/; s/\(USE_DATABASE_FOR_SESSIONS', '\)__USE_DATABASE_FOR_SESSIONS__/\1true/" \
/var/www/simplerisk/includes/config.php
grep -c -E "'__[A-Z_]+__'" /var/www/simplerisk/includes/config.php
rm /var/www/simplerisk/database.sql
The grep -c should print 0, meaning no __PLACEHOLDER__ value is left in the file. To confirm the schema went in, count the tables.
mysql -N -e "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema='simplerisk'"
Any number above zero means the import ran (155 when this guide was verified).

The database password now lives only in config.php. If you want a copy for your password manager, print it with echo "$DBPASS" before you close the shell.
6. Point Apache at SimpleRisk
Replace the default HTTP site with one that serves SimpleRisk and sends every request to HTTPS.
cat > /etc/apache2/sites-available/000-default.conf <<'EOF'
DocumentRoot /var/www/simplerisk RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
EOF
sed -i 's|/var/www/html|/var/www/simplerisk|g' /etc/apache2/sites-available/default-ssl.conf
SimpleRisk relies on .htaccess files to protect its own directories, so Apache has to honor them. This drop-in turns that on and switches off directory listings.
cat > /etc/apache2/conf-available/simplerisk.conf <<'EOF'
AllowOverride All Require all granted Options -Indexes
EOF
a2enconf simplerisk
Tighten two defaults: restrict Apache to TLS 1.2, and stop it announcing its version.
sed -i 's/\(SSLProtocol\) all -SSLv3/\1 TLSv1.2/' /etc/apache2/mods-enabled/ssl.conf
sed -i 's/\(ServerTokens\) OS/\1 Prod/; s/\(ServerSignature\) On/\1 Off/' /etc/apache2/conf-enabled/security.conf
apache2ctl configtest
systemctl restart apache2
configtest must end with Syntax OK. If it doesn't, read the message before restarting, because a failed restart takes the site down.

7. Create the log directory and the scheduled job
SimpleRisk writes its application log to /var/log/simplerisk. The directory belongs to the web server's account, with no access for anyone else.
mkdir -p /var/log/simplerisk
touch /var/log/simplerisk/simplerisk.log
chown -R www-data:www-data /var/log/simplerisk
chmod 750 /var/log/simplerisk
chmod 640 /var/log/simplerisk/simplerisk.log
The scheduled job runs every minute as the web server's account, never as root. It's what sends notifications, runs queued background work, and takes backups, so a missing job shows up as features that quietly never fire. See The Cron Jobs for what it does.
echo "* * * * * www-data $(which php) -f /var/www/simplerisk/cron/cron.php" > /etc/cron.d/simplerisk
chmod 644 /etc/cron.d/simplerisk
Confirm both are in place.
ls -l /var/log/simplerisk
cat /etc/cron.d/simplerisk

8. Open the firewall
Allow SSH first. Enabling the firewall without it cuts off your own session.
apt-get install -y ufw
ufw allow ssh
ufw allow http
ufw allow https
ufw --force enable
ufw status
The status should read active, with SSH (22), HTTP (80), and HTTPS (443) allowed.

9. Check the install, then finish in the browser
From the server, confirm both ports answer. The -k accepts the self-signed certificate.
curl -sk -o /dev/null -w '%{http_code}\n' https://localhost/
curl -s -o /dev/null -w '%{http_code}\n' http://localhost/
The first should print 200 and the second a redirect code such as 302.

Now open https://{your-simplerisk-host}/ in a browser. It will warn that the certificate isn't trusted, because of the self-signed certificate; accept it for now and replace the certificate when you reach HTTPS and TLS Configuration.
You won't see the installation wizard described in The Initial Configuration Wizard. The database and config.php are already in place, so SimpleRisk goes straight to creating the first administrator. Enter a username, your full name, an email address, and a strong password, twice. The mailing-list box is optional and starts unticked. Select CREATE.

SimpleRisk then shows the login page. Sign in with the account you just created.

You land on the Home dashboard, with a Welcome to SimpleRisk card that lists the first steps. The counters read zero because nothing has been entered yet.

From here, register the instance so it can receive updates, following Registration and Licensing.
Common pitfalls
- Running the commands as a normal user with
sudoin front of only some of them. A redirect like> /etc/apache2/...happens in your shell, beforesudoapplies, and fails with "permission denied". Use one root shell for the whole article. - Skipping the fingerprint check in Step 1. It's the only thing standing between a typo in a URL and a malicious PHP package on your server.
- Leaving the database password only in your shell history.
DBPASSdisappears when you close the shell. The copy that matters is the one inconfig.php; save a second one in your password manager now, not after a restart. - A site that loads but ignores its rules. If Step 6's
AllowOverride Alldidn't take, SimpleRisk still renders, but the directory protections its.htaccessfiles provide aren't in force. Confirm withapache2ctl -Sandapache2ctl -Mthat the site is the one you edited and thatrewriteis listed. - Ownership that says
rootin the group column. On Ubuntu 26.04 a barechown -R www-data: ...doesn't set the group the way older releases do. Usewww-data:www-dataas the steps above do, andls -lwill showwww-datain both columns. - Looking for the installation wizard. A manual install skips it, as the last step explains. The first thing you'll see is the administrator form.
- Uninstalling by deleting
/var/www/simplerisk. The scheduled job from Step 7 keeps firing every minute and will recreate the log directory behind you. Remove/etc/cron.d/simpleriskfirst.