Deployment guide

Mercator

Overview

Mercator is an open-source application for mapping the cartography of an information system, following the approach published by ANSSI, the French national cybersecurity agency. Security, risk and architecture teams use it as a single place to record business processes, applications, servers, databases, networks, sites, security controls and risks, and how they relate to each other.

This SecureAnyCloud image installs Mercator 2026.06.28 from the official upstream source on Ubuntu 24.04 on Azure, together with nginx, PHP 8.4 FPM, MariaDB from Ubuntu 24.04 and Graphviz, all wired together. Mercator renders your inventory as cartography diagrams, and unattended security upgrades keep the server patched on your running VM.

What you get:

  • Four components in one appliance: nginx and php8.4-fpm serve the application on port 80, mariadb stores every application, server, network and risk you record, and Graphviz turns the inventory into diagrams
  • Mercator 2026.06.28 served by nginx and PHP 8.4 FPM, with the Laravel public/ directory as the only web root
  • MariaDB (mariadb.service) holding the cartography data, bound to 127.0.0.1:3306, while PHP FPM listens on a Unix socket. Neither is exposed to the network, so port 80 is the only reachable surface
  • A Laravel deployment with the document root at the framework's public/ directory and nothing above it. The application source, vendored dependencies, database migrations and .env, which holds this VM's application key and database password, live outside any URL the web server can address. Only the framework front controller can execute PHP, so a file placed elsewhere in the web root is refused rather than run
  • No shared administrator credential. Mercator's database seeder normally creates a documented default administrator (admin@admin.com / password). This image ships no .env, no application key and no database schema, so that default account does not exist in the image
  • First-boot provisioning on every VM: a one-shot service generates a unique Laravel APP_KEY, a unique database password and a unique administrator password, creates the database schema and rotates the seeded administrator to your per-instance password. It then verifies that the new password signs in through the real login form and that admin@admin.com/password and other common guesses do not, and writes /root/mercator-credentials.txt (mode 0600, root only)
  • A per-instance application key: APP_KEY is Laravel's session, cookie and encryption signing material. It is generated on your VM, so nobody holding the image can forge a signed session for another instance
  • A gated start: nginx and php8.4-fpm are each gated on a bootstrap marker that first boot writes only after every credential is in place and the seeded administrator has been rotated. Until then systemd skips those units, so no half-provisioned instance or seeded default login is reachable. The units stay enabled, so the application comes straight back after a reboot
  • An inventory covering processes, applications, modules, services, logical and physical servers, databases, information, networks, VLANs, sites and buildings, with relationships modelled between them
  • Automatic cartography diagram generation, a data protection (GDPR) view, a security controls and maturity model with reports, a documents library, and a REST API with configurable rate limiting
  • Local accounts with roles and fine-grained permissions, and optional LDAP or Keycloak single sign-on against your own directory
  • Per-instance application key, database password and administrator password documented in /root/mercator-credentials.txt (0600), with the seeded default administrator rotated and confirmed unusable

Prerequisites

  • An active Azure subscription, an SSH public key, and a VNet and subnet in the target region
  • A subscription to the Mercator listing on Azure Marketplace
  • Network security group (NSG) rules that allow TCP 22 (administration) and TCP 80 (the application) from the networks that need them
  • Optional: a registered domain and access to your DNS provider, if you want your team to reach the instance by name rather than by IP address
1

Deploy from the Azure Portal

Search the Azure Marketplace for Mercator, select the SecureAnyCloud publisher, and click Create. Choose Standard_B2s or larger.

Configure the network security group to allow TCP 80 for the application from your own networks, and TCP 22 for administration from your administrative networks only. The database and the PHP runtime stay on loopback and are never exposed.

2

Deploy from the Azure CLI

RG="mercator-prod"; LOCATION="eastus"; VM_NAME="mercator" IMAGE_URN="sac1647283583153:mercator-ubuntu-24-04:default:latest" SSH_KEY="$(cat ~/.ssh/id_rsa.pub)" az group create --name "$RG" --location "$LOCATION"
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:mercator-ubuntu-24-04:default:latest
az vm create \
  --resource-group "$RG" --name "$VM_NAME" \
  --image "$IMAGE_URN" \
  --size Standard_B2s \
  --admin-username azureuser \
  --ssh-key-values "$SSH_KEY" \
  --public-ip-sku Standard
az vm open-port --resource-group "$RG" --name "$VM_NAME" --port 80 --priority 1001
az vm open-port --resource-group "$RG" --name "$VM_NAME" --port 22 --priority 1002
3

First boot and your credentials

On first boot the image generates this VM's application key, database password and administrator password, and creates the database schema. It rotates the seeded administrator to your per-instance password, opens the bootstrap gate and starts the web server. It then verifies that the new credentials work and the defaults are rejected, and writes /root/mercator-credentials.txt. This completes within a minute or two.

SSH in as azureuser and read the details:

sudo cat /root/mercator-credentials.txt

The file is mode 0600 and owned by root, so only a privileged user can read it. It contains the instance URL, the administrator login and password, and the database name, user and password.

4

Confirm the appliance is running

Run the commands below. All three services should report active. The ss output confirms that the application listens on port 80 while MariaDB is bound to loopback only, and the response headers carry no server version banner.

systemctl is-active mariadb.service php8.4-fpm.service nginx.service php -r 'echo "PHP ".PHP_VERSION."\n";' mysql --version nginx -v dot -V ss -tlnp | grep -E ':(80|3306) ' | sed 's/users:.*//' | sort curl -sI http://127.0.0.1/login | head -4
5

Sign in to your instance

Browse to http://<your-vm-public-ip>/. Mercator redirects you to the sign-in page. Enter the login admin@admin.com and the password from the credentials file.

You can verify the same sign-in from the command line. The script uses the per-instance password from the credentials file to complete a real login through the form. It then checks that the seeded default and other common passwords are refused:

sudo /usr/local/sbin/mercator-login-check.sh admin@admin.com '<MERCATOR_ADMIN_PASSWORD>' && echo "per-VM password: ACCEPTED (correct)"
sudo /usr/local/sbin/mercator-login-check.sh admin@admin.com 'password' || echo "admin@admin.com/password: REJECTED (correct)"
sudo /usr/local/sbin/mercator-login-check.sh admin@admin.com '' || echo "blank password: REJECTED (correct)"
6

The cartography dashboard

After you sign in, you land on the dashboard. The left navigation holds the whole cartography model, grouped into views: the GDPR view, the Ecosystem view, the Business view of the information system, the Applications view, the Administration view, and the views of logical and physical infrastructure.

The main panel shows the maturity levels of your cartography and a breakdown by domain. Both start at zero on a fresh instance and fill in as you record your estate.

7

Change the administrator password

Set your own password as soon as you have signed in. Open Preferences in the top bar, choose your profile, and use the change password form. Enter the per-instance password from the credentials file as the current password, then choose a new one.

Mercator stores passwords as bcrypt hashes, so the new password cannot be recovered from the database. After the change, the administrator password in /root/mercator-credentials.txt is out of date. Keep the file for the database password, or remove the administrator password line from it.

8

Map your first application

Cartography starts with the inventory. Open Applications view > Applications and click the add button. Give the application a name. When you have them, link the entities, processes, application services, databases and logical servers it depends on. Save it, and it appears in the application inventory.

Every layer of the model works the same way. Record your entities and processes in the business view, your logical and physical servers in the infrastructure views, and your networks and equipment in the ecosystem view. Each object can be linked to the others, and those links are what the diagrams draw.

9

Generate a cartography diagram

Diagrams are the core of Mercator. Open Applications view > Applications cartography. Mercator renders the applications you have recorded as a diagram drawn by Graphviz, with the relationships between them as edges.

Use the Rendu selector to switch between the Graphviz layout engines (dot, fdp, osage, circo) and pick the layout that reads best for your estate. You can export the diagram.

The other views generate their own diagrams the same way: the ecosystem map, the network map and the physical infrastructure map. As your inventory grows, the cartography grows with it.

10

Run a maturity report

Open the Tools and report menus. Mercator scores the maturity of your cartography against its model and produces reports you can use in an audit or a steering committee.

The maturity gauges on the dashboard (Step 6) summarise the same data. As you record more of your estate and link the objects together, the maturity levels rise. This gives you a measurable picture of how complete and current your cartography is.

11

Configure mail so password reset works

A fresh instance has no working mail transport, so password reset email is not delivered until you configure one. Edit the MAIL_ values in /var/www/mercator/.env to point at your SMTP server: MAIL_HOST, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD and MAIL_FROM_ADDRESS. Then clear the cached configuration:

sudo -u www-data php /var/www/mercator/artisan config:clear

Leave the file's ownership and permissions unchanged. It is root:www-data with mode 0640 on purpose, because it holds this VM's application key and database password.

12

Enable LDAP or Keycloak single sign on

Mercator can authenticate against your own directory. LDAP and Keycloak both ship disabled in this image.

To enable LDAP, set LDAP_ENABLED=true in /var/www/mercator/.env. Then fill in LDAP_HOST, LDAP_PORT, the bind LDAP_USERNAME and LDAP_PASSWORD, and LDAP_USERS_BASE_DN for your directory. Set LDAP_FALLBACK_LOCAL=true to keep local logins working alongside LDAP.

To enable Keycloak single sign-on, set KEYCLOAK_ENABLED=true and fill in KEYCLOAK_CLIENT_ID, KEYCLOAK_CLIENT_SECRET, KEYCLOAK_BASE_URL, KEYCLOAK_REALM and KEYCLOAK_REDIRECT_URI.

After editing .env, clear the cached configuration:

sudo -u www-data php /var/www/mercator/artisan config:clear
13

Use your own domain and add TLS

Point a DNS A record at the VM's public IP, then set APP_URL in /var/www/mercator/.env to https://your.domain.

For TLS, the simplest option is a certificate from Let's Encrypt with the nginx plugin. The plugin edits the shipped nginx site in place and reloads it. Replace <your-domain> with your fully qualified domain:

sudo apt-get update && sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot --nginx -d <your-domain> --redirect --agree-tos -m admin@<your-domain> -n

After certbot has installed the certificate, set APP_FORCE_HTTPS=true in .env and clear the cache, so that every generated URL uses HTTPS.

14

How the security model works

The image ships no .env, no application key and no database schema, so the seeded default administrator does not exist in it. nginx and php8.4-fpm are gated on a bootstrap marker. First boot writes the marker only after your per-instance secrets exist and the seeded administrator has been rotated. Until then, systemd skips the serving units and nothing is reachable.

Run the following to inspect the gate and the enabled units:

grep -E 'ConditionPathExists|After=' /etc/systemd/system/nginx.service.d/sac-bootstrap-gate.conf ls -l /var/lib/sac/data/ systemctl is-enabled php8.4-fpm.service nginx.service mercator-firstboot.service

The document root is the Laravel public/ directory and nothing above it, and only the front controller executes PHP. To confirm that nothing above public/ is reachable over HTTP, run:

grep -E '^\s+root ' /etc/nginx/sites-available/mercator for p in /.env /config/app.php /vendor/autoload.php /artisan; do printf '%-28s HTTP %s\n' "$p" "$(curl -s -o /dev/null -w '%{http_code}' -m 10 http://127.0.0.1$p)" done curl -s -o /dev/null -w '/login HTTP %{http_code}\n' http://127.0.0.1/login
15

Back up your instance

The whole state of your cartography lives in the MariaDB database and the .env file. Take a consistent dump on a schedule and copy it off the VM, for example to Azure Blob Storage:

TS="$(date +%F-%H%M)" DB_PASS="$(sudo sed -n 's/^mercator.db.password=//p' /root/mercator-credentials.txt)"
sudo mysqldump --single-transaction -u mercator_user -p"$DB_PASS" mercator > "/tmp/mercator-$TS.sql" echo "wrote /tmp/mercator-$TS.sql"

Keep a copy of /var/www/mercator/.env with the backup. It holds the application key that signs your sessions and the database password, so restoring the database without it invalidates existing sessions.

16

Keeping Mercator up to date

The operating system patches itself through unattended upgrades. For Mercator itself, SecureAnyCloud publishes refreshed images as upstream releases new versions.

The supported upgrade path is to deploy the new image and restore your database into it, which keeps the appliance hardening intact. SecureAnyCloud support can help you plan and carry out an upgrade.

Troubleshooting

The site does not load. Check that first boot has finished. systemctl is-active mercator-firstboot.service should report active, and /var/lib/sac/data/mercator-firstboot.done should exist. If first boot is still running, wait a minute and retry. If it failed, sudo journalctl -u mercator-firstboot.service shows why.

The serving units are inactive. nginx and php8.4-fpm are gated on /var/lib/sac/data/mercator-bootstrap-ready. If that marker is missing, first boot has not completed. The units stay inactive until it does.

I cannot sign in. Read the current password from /root/mercator-credentials.txt. If you changed it and lost the new one, reset it with sudo -u www-data php /var/www/mercator/artisan tinker and update the password of the admin@admin.com user. You can also contact SecureAnyCloud support.

Diagrams do not render. Confirm Graphviz is installed with dot -V; the cartography views call dot to draw the diagrams.

A change to .env had no effect. Clear the cached configuration with sudo -u www-data php /var/www/mercator/artisan config:clear.

Support

SecureAnyCloud provides 24/7 technical support for this Mercator image by email (sales@secureanycloud.com) and live chat, with a one-hour average response time for critical issues.

We help with first boot and credentials, rotating the administrator password, the cartography model and diagram generation, the security controls and maturity reports, LDAP and Keycloak single sign-on against your own directory, mail delivery, domain and TLS setup, the REST API, database backup and restore, performance tuning and version upgrades. For billing or subscription changes, contact sales@secureanycloud.com.

Mercator is free software licensed under the GNU General Public License version 3. All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.

Deploy on Azure

Launch Mercator 2026.06.28 Cartography on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure