Deployment guide

Open Web Analytics

Overview

Open Web Analytics (OWA) is an open-source, self-hosted web analytics framework and a privacy-respecting alternative to Matomo and Google Analytics. It measures visits, page views, unique visitors, referrers, search terms, campaigns, and click and DOM heatmaps. You add its JavaScript or PHP tracker to any website or application, and you keep full ownership of the data.

The SecureAnyCloud image runs Open Web Analytics on Apache and PHP 8.3, on a hardened, fully patched Ubuntu 24.04 LTS base. A bundled local MariaDB server makes the appliance complete on its own. The install is finished at build time and the install wizard is locked away, so the dashboard is ready the moment the instance boots. It is backed by 24/7 SecureAnyCloud support.

What you get:

  • Open Web Analytics served by Apache with PHP 8.3, managed by systemd.
  • A bundled MariaDB server that holds the analytics database, already installed and ready.
  • A completed install with the wizard locked away, so no setup wizard is ever exposed.
  • A default site, so the dashboard works the moment you sign in.
  • A unique administrator password, database password and set of application secrets, generated on the first boot of every VM and recorded in a root-only file.
  • No default login. The administrator password ships rotated to a discarded random value, and the real per-VM password is set on first boot.
  • A clean, empty analytics dataset, so your reports start fresh.
  • MariaDB bound to 127.0.0.1:3306 only, so it is never exposed to the network.
  • A public URL derived from the request, so the tracking snippet and links work on the public IP, the private IP or any DNS name you point at the VM.
  • apache2.service and mariadb.service as enabled systemd units.
  • An unauthenticated /healthz endpoint for Azure Load Balancer health probes.

Prerequisites

  • An active Azure subscription, an SSH key pair, and a VNet with a subnet in the target region.
  • Standard_B2s (2 vCPU, 4 GiB RAM) is a sensible starting point. Move up to Standard_D2s_v3 for high-traffic sites.
  • Network security group inbound rules: allow 22/tcp from your management network, 80/tcp for the application, and 443/tcp if you terminate TLS on the VM.
  • Port 3306 stays off the network, because the bundled MariaDB listens on 127.0.0.1 only.

Step 1 - Deploy from the Azure Marketplace

In the Azure portal, choose Create a resource. Search for Open Web Analytics on Ubuntu 24.04 LTS by SecureAnyCloud, and select Create.

Pick your subscription, resource group and region, and choose the Standard_B2s size. Select SSH public key authentication with the username azureuser, and allow inbound ports 22, 80 and 443.

Step 2 - Deploy from the Azure CLI

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:open-web-analytics-ubuntu-24-04:default:latest
az vm create \
  --resource-group <your-rg> \
  --name open-web-analytics \
  --image sac1647283583153:open-web-analytics-ubuntu-24-04:default:latest \
  --size Standard_B2s \
  --admin-username azureuser \
  --generate-ssh-keys \
  --public-ip-sku Standard

Then open ports 80 and 443:

az vm open-port --resource-group <your-rg> --name open-web-analytics --port 80,443

Step 3 - Confirm the services are running

SSH to the VM as azureuser and confirm that Apache, MariaDB and the first-boot service are all active. MariaDB is bound to 127.0.0.1:3306 only, while Apache serves on port 80.

systemctl is-active apache2 mariadb open-web-analytics-firstboot
ss -tlnp | grep -E ':80 |:3306 ' | sed 's/ */ /g'

Step 4 - Retrieve the per-VM administrator password

The first-boot service generates an administrator password unique to your VM and writes it to a root-only file. Read the file over SSH:

sudo cat /root/open-web-analytics-credentials.txt

OPEN_WEB_ANALYTICS_URL is the VM's own address as seen from inside the VM. Azure does not expose the public IP to the instance, so this is usually the private address.

Browsing the public IP shown in the Azure portal works identically. The image derives OWA's public URL from the request rather than baking one in at build time.

Step 5 - Sign in

Browse to http://<vm-ip>/ and sign in with the username admin and the password from the credentials file.

You land on the analytics Dashboard. It shows the site metrics chart with visits, unique visitors, page views, average visit duration, bounce rate and pages per visit. It also shows the top content, visitor types and traffic sources for the selected period.

Step 6 - Explore your reports

Use the sidebar to move between the report families:

  • Content covers top pages, entry and exit pages, and page types.
  • Visitors covers loyalty, recency, geolocation, browsers and operating systems.
  • Traffic covers referring sites, search engines, keywords and campaigns.
  • Action Tracking covers the actions you define.

Each report has its own date range picker and a live view toggle. The Top Pages report below breaks every tracked URL down by page views, visits and unique page views.

Step 7 - Track your own website

The image ships with a default site, so the dashboard works immediately. To track your own website, open Settings. Either edit the default site's domain or add a new site, and then open its Tracking Tag page.

Copy the generated JavaScript snippet into the HTML of your pages, just before the closing </body> tag. OWA starts recording visits straight away. A PHP tracker and a REST tracking API are also available for server-side tracking.

Step 8 - No known or default credentials

This image ships with no usable login. The administrator password created at build time is rotated to a random value that is discarded and never recorded.

Before OWA serves a single request, the first-boot service sets a fresh password unique to your VM, regenerates the application secrets and rotates the database password. The admin account is the only account that can sign in. The check below confirms that the per-VM password authenticates through the real OWA login form, while a blank password and common weak guesses are all rejected.

sudo mariadb --protocol=socket -uroot -N -e "SELECT CONCAT(user_id,' (the only account that can sign in)') FROM owa.owa_user"
sudo bash /usr/local/sbin/open-web-analytics-cred-roundtrip.sh

After you sign in for the first time, change the administrator password to one of your own under the OWA user settings.

Step 9 - Verify the stack

Confirm the installed release, the health endpoint and that the analytics engine is recording:

php -r "require '/var/www/owa/owa_env.php'; echo 'Open Web Analytics '.OWA_VERSION;"
curl -sI http://127.0.0.1/healthz | head -1
sudo mariadb --protocol=socket -uroot -N -e "SELECT CONCAT((SELECT COUNT(*) FROM owa.owa_session),' visits, ',(SELECT COUNT(*) FROM owa.owa_request),' page views across ',(SELECT COUNT(*) FROM owa.owa_document),' pages') AS tracked"

Adding your own domain and TLS

Open Web Analytics derives its public URL from the request. Pointing a DNS name at the VM is all you need for the tracking snippet and links to use that name, and no configuration change is required.

To terminate TLS on the VM itself, install a certificate with Certbot:

sudo apt-get update && sudo apt-get install -y certbot python3-certbot-apache
sudo certbot --apache -d analytics.your-domain.com

Certbot configures the Apache virtual host and renews the certificate automatically. OWA switches its generated snippet and links to https:// on its own once requests arrive over TLS.

To pin one fixed public URL instead of following the request, replace the SecureAnyCloud host-derived block in /var/www/owa/owa-config.php with a single line, for example define('OWA_PUBLIC_URL', 'https://analytics.your-domain.com/');.

Backing up

Everything that matters lives in the MariaDB database. Dump the database, and snapshot the OS disk from the Azure portal for a complete point-in-time backup:

sudo mariadb-dump --protocol=socket -uroot --single-transaction --routines owa > /var/tmp/owa-backup.sql

Security notes

  • The administrator password is unique to every VM. First boot generates it into a 0600 root:root file, alongside a rotated database password and freshly generated application secrets. No default or shared login ships in the image.
  • The image ships a clean, empty analytics dataset. The demo traffic used to validate the build is removed before capture.
  • The install and CLI entrypoints are denied from the web: /install.php and /cli.php return 403, and owa-config.php is never web-readable.
  • MariaDB listens on 127.0.0.1:3306 only and is never reachable from the network. On-box maintenance uses sudo mariadb as root@localhost over the unix socket, with no password.
  • The session cookie is host-only, so it is scoped to exactly the address you browse to.
  • The OS is fully patched at build time, and unattended security upgrades stay enabled on your VM.
  • Restrict 22/tcp to your management network, and put the site behind TLS before you collect production traffic.

Trademark

Open Web Analytics is a trademark of its respective owner. SecureAnyCloud is not affiliated with or endorsed by the Open Web Analytics project. All product and company names are trademarks or registered trademarks of their respective holders.

Support

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

Deploy on Azure

Launch Open Web Analytics 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