Deployment guide

SQL Server 2025 Express

Overview

SQL Server 2025 is Microsoft's current relational database platform. It delivers Azure Arc enabled services out of the box, a query store that is on by default, intelligent query processing, ledger tables for tamper-evident audit, and accelerated database recovery on every edition. Express Edition suits departmental workloads, smaller production databases, and teams that do not need the unlimited scale of Enterprise but still need a production-supported SQL Server on Linux.

This guide covers the deployment and configuration of SQL Server 2025 Express on Ubuntu 24.04 on Azure, using SecureAnyCloud Azure Marketplace images. The image installs SQL Server 2025 Express Edition from the official Microsoft APT repository at packages.microsoft.com, pinned to Ubuntu 24.04 noble. The build verifies the Microsoft GPG key, so the chain of trust is unambiguous.

On every fresh customer virtual machine, mssql-firstboot.service rotates the SA password from the temporary build-time value to a strong random value unique to that virtual machine. It also creates the default SecureAnyCloud database, provisions a SecureAnyCloud SQL login with db_owner on that database, removes the build-time memory cap, and writes the credentials to /stage/scripts/mssql-credentials.log. No two virtual machines ever share an SA password, and no password is baked into the image at any point.

Bring your own license. This image contains SQL Server 2025 Express Edition binaries. The Standard software license is NOT included. Apply your own Standard product key on first login. Without a product key, Standard features run in evaluation mode for 180 days. After the evaluation period expires, you must apply a valid Standard license to keep the service operational.

What you get:

  • Microsoft SQL Server 2025 Express Edition from packages.microsoft.com
  • mssql-tools18, including sqlcmd and bcp for database administration
  • A listener on TCP port 1433 on every interface by default
  • Per-VM SA and SecureAnyCloud passwords generated on first boot and written to /stage/scripts/mssql-credentials.log
  • A default SecureAnyCloud database created on first boot
  • A SecureAnyCloud SQL login with the db_owner role on the SecureAnyCloud database
  • The systemd service mssql-server.service for automatic startup on boot
  • The systemd oneshot mssql-firstboot.service for idempotent per-VM credential rotation
  • An Ubuntu 24.04 LTS base with the latest security patches applied at build time
  • The Azure Linux Agent for cloud integration and SSH key injection
  • 24/7 SecureAnyCloud support with a guaranteed 24-hour response SLA

Prerequisites

Before you deploy this image, make sure you have:

  • An active Azure subscription
  • A subscription to the SQL Server 2025 Express on Ubuntu 24.04 listing on Azure Marketplace
  • A valid SQL Server 2025 Express product key for BYOL activation
  • An SSH public key for virtual machine authentication
  • Familiarity with Azure virtual machine management and SSH
  • A virtual network and subnet in the target region

The recommended virtual machine size is Standard_D2s_v5 (2 vCPU, 8 GB RAM) or larger. Express Edition supports up to 24 cores and 128 GB of buffer pool RAM. For typical departmental workloads, Standard_D4s_v5 (4 vCPU, 16 GB RAM) is a comfortable starting point with room to grow.

1

Deploy the virtual machine from the Azure portal

In the Azure Portal, open Marketplace, search for SQL Server 2025 Express, and select the SecureAnyCloud publisher entry. Select Create to begin the wizard.

On the Basics tab, choose your subscription, target resource group, and region. Set the virtual machine name. Choose SSH public key as the authentication type, set the username to a name of your choice (the examples below use azureuser), and paste your SSH public key. Standard_D2s_v5 is the recommended starting size.

On the Disks tab, set the OS disk type to Standard SSD or Premium SSD. SQL Server data lives at /var/opt/mssql/data on the root disk by default. For production workloads, attach a separate Premium SSD data disk and bind mount it over /var/opt/mssql/data before you start the service.

On the Networking tab, select your existing virtual network and subnet. Attach a network security group that allows inbound TCP 22 from your management IP range, and inbound TCP 1433 only from application server subnets or the virtual network CIDR.

Do not expose port 1433 to the public internet. The SA password is written in plain text on the virtual machine by design, so you can read it without a second trip. An internet-exposed SQL Server port would make brute-force attacks trivial.

On the Management, Monitoring, and Advanced tabs, the defaults are appropriate. Select Review + create, wait for validation to pass, then select Create. Deployment takes around two minutes.

2

Deploy the virtual machine from the Azure CLI

To use the command line instead, accept the Marketplace terms once, then deploy from the Marketplace image URN:

RG="mssql-prod" LOCATION="eastus" VM_NAME="mssql-01" ADMIN_USER="azureuser" IMAGE_URN="sac1647283583153:mssql-2025-express-ubuntu-24-04:default:latest" SSH_KEY="$(cat ~/.ssh/id_rsa.pub)" az group create --name "$RG" --location "$LOCATION" az network vnet create \
  --resource-group "$RG" \
  --name mssql-vnet \
  --address-prefix 10.80.0.0/16 \
  --subnet-name mssql-subnet \
  --subnet-prefix 10.80.1.0/24 az network nsg create --resource-group "$RG" --name mssql-nsg az network nsg rule create \
  --resource-group "$RG" --nsg-name mssql-nsg \
  --name allow-ssh-mgmt --priority 100 \
  --source-address-prefixes "<your-mgmt-cidr>" \
  --destination-port-ranges 22 --access Allow --protocol Tcp az network nsg rule create \
  --resource-group "$RG" --nsg-name mssql-nsg \
  --name allow-sql-vnet --priority 110 \
  --source-address-prefixes VirtualNetwork \
  --destination-port-ranges 1433 --access Allow --protocol Tcp
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:mssql-2025-express-ubuntu-24-04:default:latest
az vm create \
  --resource-group "$RG" \
  --name "$VM_NAME" \
  --image "$IMAGE_URN" \
  --size Standard_D2s_v5 \
  --admin-username "$ADMIN_USER" \
  --ssh-key-values "$SSH_KEY" \
  --nsg mssql-nsg \
  --vnet-name mssql-vnet \
  --subnet mssql-subnet \
  --storage-sku Premium_LRS \
  --location "$LOCATION"
3

Connect to the virtual machine

When the virtual machine is running, connect over SSH. Use the private IP address from inside the virtual network, or the public IP if you have configured a bastion or direct management access. The default admin user is azureuser.

ssh azureuser@<vm-ip>
4

Confirm the service is running

The mssql-firstboot.service runs automatically on first boot and completes within about 90 seconds. By the time your SSH session is open, first boot is typically already done. Confirm the service status:

sudo systemctl status mssql-server.service --no-pager

You should see active (running). Confirm that the first-boot sentinel exists:

sudo test -f /var/opt/mssql/.firstboot-done && echo FIRSTBOOT_DONE

Confirm that the TCP listener is bound on port 1433:

sudo ss -tln | grep 1433
5

Retrieve the SA and SecureAnyCloud passwords

First boot generated the SA and SecureAnyCloud passwords randomly on this specific virtual machine and wrote them to a file that only root can read. Read them with:

sudo cat /stage/scripts/mssql-credentials.log

The output contains lines similar to:

SA_USER=sa SA_PASSWORD=<SA_PASSWORD> SAC_USER=sac SAC_PASSWORD=<SAC_PASSWORD> SAC_DATABASE=sac

Store the values in your secret store. You can shred the credentials file once you have saved the passwords. Keeping it root-protected at mode 0600 is a reasonable default for the life of the virtual machine.

6

Connect locally with sqlcmd

The mssql-tools18 package installs sqlcmd at /opt/mssql-tools18/bin/sqlcmd. Verify that the binary is on PATH:

sudo ls -l /opt/mssql-tools18/bin/sqlcmd

Connect to the server as SA, reading the password directly from the credentials file:

SA_PASS=$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /stage/scripts/mssql-credentials.log) /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$SA_PASS" -C -Q "SELECT @@VERSION;"

The server reports Microsoft SQL Server 2025.

7

Confirm the Express edition

Query the running edition:

SA_PASS=$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /stage/scripts/mssql-credentials.log) /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$SA_PASS" -C -Q "SELECT SERVERPROPERTY('Edition') AS Edition;" -h -1 -W

You should see Express Edition (64-bit).

8

Apply your Standard license key

The image ships Standard binaries in evaluation mode. Apply your product key to activate the license. Replace YOUR_STANDARD_LICENSE_KEY with the key from your Microsoft Volume Licensing agreement:

sudo /opt/mssql/bin/mssql-conf setpid YOUR_STANDARD_LICENSE_KEY
sudo systemctl restart mssql-server.service

After the restart, verify that the license is active:

SA_PASS=$(sudo awk -F= '/^SA_PASSWORD=/{print $2}' /stage/scripts/mssql-credentials.log) /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$SA_PASS" -C -Q "SELECT SERVERPROPERTY('LicenseType') AS LicenseType;" -h -1 -W

The value PER_CORE confirms a perpetual Standard license. The value EVAL means the 180-day evaluation period is still active.

9

Run a round-trip test with sqlcmd

The SecureAnyCloud database and SecureAnyCloud login are ready to use from first boot. Run a round-trip query as the SecureAnyCloud user:

CL_PASS=$(sudo awk -F= '/^SAC_PASSWORD=/{print $2}' /stage/scripts/mssql-credentials.log) /opt/mssql-tools18/bin/sqlcmd -S localhost -U sac -P "$CL_PASS" -C -d sac -h -1 -W -Q "CREATE TABLE ##probe (id INT, val NVARCHAR(64)); INSERT INTO ##probe VALUES (1, N'sac-ok'); SELECT val FROM ##probe WHERE id=1; DROP TABLE IF EXISTS ##probe;"

The output includes sac-ok, which confirms that the SecureAnyCloud user has the expected permissions on the SecureAnyCloud database.

10

Connect from a remote client

From any host inside the same virtual network that has sqlcmd or SQL Server Management Studio installed, connect on port 1433 with the SA or SecureAnyCloud credentials. A typical sqlcmd invocation from a remote client looks like this:

sqlcmd -S <private-ip>,1433 -U sa -P '<SA_PASSWORD>' -C -d sac

SQL Server Management Studio and Azure Data Studio connect the same way, using the virtual machine's private IP and the SA or SecureAnyCloud credentials.

To connect from a management workstation outside the virtual network, use Azure Bastion or an SSH tunnel. Do not open port 1433 to the public internet.

11

Server components

These are the paths of the main server components:

  • SQL Server daemon: /opt/mssql/bin/sqlservr
  • sqlcmd client: /opt/mssql-tools18/bin/sqlcmd
  • bcp bulk copy utility: /opt/mssql-tools18/bin/bcp
  • mssql-conf configuration tool: /opt/mssql/bin/mssql-conf
  • SQL Server data directory: /var/opt/mssql/data/
  • SQL Server log directory: /var/opt/mssql/log/
  • Systemd unit: /lib/systemd/system/mssql-server.service
  • First-boot systemd unit: /etc/systemd/system/mssql-firstboot.service
  • First-boot script: /usr/local/sbin/mssql-firstboot.sh
  • Credentials file: /stage/scripts/mssql-credentials.log
  • First-boot sentinel: /var/opt/mssql/.firstboot-done

Inspect the running mssql-server package version:

dpkg -l mssql-server mssql-tools18 | awk '/^ii/{print $2, $3}'
12

Filesystem layout

The image uses this filesystem layout:

  • / (32 GB): root filesystem, which includes /var/opt/mssql
  • /boot (1 GB): operating system kernel files
  • /var/opt/mssql/data (on root): SQL Server data directory
  • /var/opt/mssql/log (on root): SQL Server transaction logs and error logs

For production workloads, attach a separate Premium SSD data disk, format it with xfs, and bind mount it over /var/opt/mssql/data before you start the service. Place the transaction log directory on a separate disk for IO isolation.

This layout keeps database IO off the OS disk and lets you resize and snapshot the data and log volumes independently.

13

Manage the SQL Server service

systemd starts and stops SQL Server through the mssql-server.service unit.

Check service status:

sudo systemctl status mssql-server.service --no-pager

Stop SQL Server:

sudo systemctl stop mssql-server.service && echo "mssql-server stopped"

Start SQL Server:

sudo systemctl start mssql-server.service && echo "mssql-server started"

Restart SQL Server:

sudo systemctl restart mssql-server.service && echo "mssql-server restarted"

View the SQL Server error log:

sudo tail -n 50 /var/opt/mssql/log/errorlog
14

Troubleshoot common problems

Cannot connect to SQL Server on port 1433

  • Verify that the service is running: sudo systemctl status mssql-server.service
  • Verify that the listener is bound: sudo ss -tln | grep 1433
  • Check the error log: sudo tail -n 50 /var/opt/mssql/log/errorlog
  • Confirm that the network security group allows TCP 1433 from your client source IP.
  • Confirm that the virtual machine NIC is in the expected subnet with the NSG attached.

Authentication errors after connecting

  • Read the SA password again: sudo awk -F= '/^SA_PASSWORD=/{print $2}' /stage/scripts/mssql-credentials.log
  • Verify that the first-boot sentinel exists: ls -la /var/opt/mssql/.firstboot-done. If it is absent, mssql-firstboot.service did not complete, so check its journal.
  • Check the first-boot journal: sudo journalctl -u mssql-firstboot.service --no-pager

First-boot service did not run

  • Check the first-boot service status: sudo systemctl status mssql-firstboot.service --no-pager
  • Review the journal: sudo journalctl -u mssql-firstboot.service --no-pager -n 100
  • Verify that SQL Server started: sudo systemctl status mssql-server.service
  • If SQL Server failed to start, check the error log: sudo tail -n 100 /var/opt/mssql/log/errorlog

License evaluation expiry

  • Run SELECT SERVERPROPERTY('LicenseType') to see the current state. EVAL means the 180-day evaluation is still active.
  • Apply your Standard product key: sudo /opt/mssql/bin/mssql-conf setpid <your-product-key> then sudo systemctl restart mssql-server.service
  • After the restart, confirm that the new state is PER_CORE.

Service fails to start

  • Check the systemd journal: sudo journalctl -u mssql-server.service --no-pager -n 100
  • Check the SQL Server error log: sudo tail -n 100 /var/opt/mssql/log/errorlog
  • Check filesystem space: df -h /var/opt/mssql
  • Verify data directory ownership: sudo ls -la /var/opt/mssql/data | head. Files should be owned by mssql:mssql.
15

Apply the security recommendations

  • Rotate the SA password on a schedule with ALTER LOGIN [sa] WITH PASSWORD=N'<new-password>';
  • Create application-specific logins with minimal privileges. Never connect application code as SA.
  • Restrict port 1433 to trusted application server subnets only in your NSG.
  • Disable the SA login once named logins are in place: ALTER LOGIN [sa] DISABLE;
  • Back up regularly with native BACKUP DATABASE statements or SQL Agent jobs.
  • Keep SQL Server updated by running sudo apt-get update && sudo apt-get upgrade mssql-server periodically. The official packages.microsoft.com APT repository is already configured on this image.
  • Shred the credentials file once the passwords are stored in your secret store: sudo shred -u /stage/scripts/mssql-credentials.log
16

Support and licensing

SQL Server 2025 Express Edition is Microsoft proprietary software. After the 180-day evaluation period, production use requires a valid per-core Standard license. Microsoft Server and SQL Server are registered trademarks of Microsoft Corporation.

SecureAnyCloud provides commercial support for this image, separately from the upstream Microsoft product. Contact us at any time for support questions, architectural advice, capacity planning, or migration help.

E-mail: sales@secureanycloud.com

Website: secureanycloud.com

Support hours: 24/7 with a guaranteed 24-hour response SLA

Deploy on Azure

Launch SQL Server 2025 Express on Ubuntu 24.04 with 24/7 support from SecureAnyCloud.

View on Marketplace

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure

Launch SQL Server 2025 Express 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