Ba
E-commerce Azure

Bagisto on Ubuntu 24.04 on Azure User Guide

| Product: Bagisto on Ubuntu 24.04 LTS on Azure

Overview

Bagisto is the popular free, open source ecommerce platform built on the Laravel framework. It pairs a customer facing storefront with a complete admin panel for managing catalog, inventory, orders, customers, CMS pages and marketing, and supports multiple channels, locales and currencies out of the box, with a REST and GraphQL API for headless front ends. The cloudimg image delivers Bagisto fully installed and configured on Ubuntu 24.04 — a Laravel application on PHP 8.3 with OPcache, served by nginx over HTTPS with php-fpm, backed by MariaDB. Migrations and seeders are already applied and the store is marked installed, so you land directly on a working storefront and admin sign-in with no setup wizard to complete. Backed by 24/7 cloudimg support.

What is included:

  • Bagisto 2.4.8 (MIT licensed), served from /var/www/bagisto/public
  • nginx (TLS on :443, with :80 redirected to HTTPS) + PHP 8.3 (php8.3-fpm with OPcache) + MariaDB, all from Ubuntu 24.04 main/universe
  • A per-VM self-signed TLS certificate generated on first boot, so the admin panel loads over a secure context
  • A dedicated Azure data disk at /var/lib/mysql (database tier) and a second at /var/www (application code, docroot and uploaded media) — each independently resizable, separate from the OS disk and re-provisioned with every VM
  • Per-VM administrator email + password, MariaDB password and Laravel APP_KEY, all generated at first boot and written to a root-only file — the well-known default admin@example.com / admin123 does not ship
  • nginx.service, php8.3-fpm.service and mariadb.service as systemd units, enabled and active
  • 24/7 cloudimg support

Bagisto storefront

Prerequisites

An active Azure subscription, an SSH key pair, and a VNet + subnet in the target region. Standard_B2ms (2 vCPU / 8 GiB RAM) is a good starting point; scale up for larger catalogs or heavier traffic. NSG inbound: allow 22/tcp from your management network and 443/tcp (HTTPS) plus 80/tcp (which redirects to HTTPS) from your customers.

Step 1 — Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Bagisto by cloudimg, and select Create. On Basics pick your subscription, resource group, region and size; under Administrator account choose SSH public key and paste your key; under Inbound port rules allow SSH (22) and HTTPS (443). Review the two dedicated data disks on the Disks tab, then Review + createCreate.

Step 2 — Deploy from the Azure CLI

az vm create \
  --resource-group <your-rg> \
  --name bagisto \
  --image <marketplace-image-urn> \
  --size Standard_B2ms \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_ed25519.pub \
  --vnet-name <your-vnet> --subnet <your-subnet> \
  --public-ip-sku Standard

az vm open-port --resource-group <your-rg> --name bagisto --port 443 --priority 1010

Step 3 — Connect to your VM

ssh azureuser@<vm-public-ip>

Step 4 — Confirm the services are running

The three services that back Bagisto should all report active, and the storefront answers HTTP 200 over HTTPS (the plain HTTP port redirects to it):

systemctl is-active nginx php8.3-fpm mariadb
curl -ks -o /dev/null -w 'storefront https -> %{http_code}\n' https://127.0.0.1/
curl -s  -o /dev/null -w 'http redirect  -> %{http_code}\n' http://127.0.0.1/

Expected: three lines of active, then storefront https -> 200 and http redirect -> 301.

Service status, HTTPS storefront and dedicated data disks

Step 5 — Retrieve your administrator credentials

On the first boot of every VM, a one-shot service (bagisto-firstboot.service) generates credentials that are unique to that VM: a fresh Laravel application key, a fresh MariaDB password, and a fresh administrator email and password. It also generates a per-VM self-signed TLS certificate and sets the VM's own address as the application URL. No shared or default credentials ship in the image — the well-known Bagisto default admin@example.com / admin123 is neutralised at build time and does not authenticate.

sudo cat /root/bagisto-credentials.txt

The file (mode 0600, root only) contains the administrator email (bagisto.admin.user), the administrator password (bagisto.admin.pass), the storefront and admin URLs, and the database credentials. Bagisto signs in by email.

Per-VM credentials and the rejected default login

You can prove the login round-trip from the VM's own shell — this reads the per-VM credentials, fetches a CSRF token and posts a real admin sign-in (a successful Bagisto admin login answers HTTP 302 to /admin/dashboard), and confirms the stock admin123 is rejected:

ADMIN_USER=$(sudo grep '^bagisto.admin.user=' /root/bagisto-credentials.txt | cut -d= -f2-)
ADMIN_PASS=$(sudo grep '^bagisto.admin.pass=' /root/bagisto-credentials.txt | cut -d= -f2-)
CJ=$(mktemp)
TOK=$(curl -ks -c "$CJ" https://127.0.0.1/admin/login | grep -oE 'name="_token" value="[^"]+"' | head -1 | sed 's/.*value="//;s/"//')
curl -ks -o /dev/null -w 'admin login -> %{redirect_url}\n' -b "$CJ" -c "$CJ" \
  -d "_token=$TOK" --data-urlencode "email=$ADMIN_USER" --data-urlencode "password=$ADMIN_PASS" \
  https://127.0.0.1/admin/login
rm -f "$CJ"

Step 6 — Sign in to the admin panel

Browse to https://<vm-public-ip>/admin and sign in with the administrator email and password from the credentials file. Because the image ships a per-VM self-signed certificate, your browser shows a one-time certificate warning on first visit — click through it, or install your own domain certificate into /etc/nginx/ssl/.

Bagisto admin sign-in

After signing in you land on the dashboard, which summarises sales, orders, customers and top selling products for your store.

Bagisto admin dashboard

Step 7 — Manage your catalog

From the admin panel's Catalog menu you manage Products, Categories, Attributes and Attribute Families. The store ships with a clean catalog ready for your own products: choose Catalog → Products → Create Product, pick a type (simple, configurable, virtual, downloadable, bundle, grouped or booking), and fill in the attributes, price, inventory and images. Use Categories to build your storefront navigation and Attributes to model your product data.

Product management in the admin panel

Step 8 — Confirm the version and the data tiers

sudo -u www-data php /var/www/bagisto/artisan bagisto:version
df -h /var/lib/mysql /var/www

Expected: v2.4.8, then the two dedicated data disks. The database tier (/var/lib/mysql) and the application tier (/var/www — code, docroot and uploaded media) each live on their own dedicated Azure data disk, so you can grow storage for either tier without disturbing the OS disk.

Version, stack and data tiers

First-boot service and security model

A one-shot bagisto-firstboot.service runs After=mariadb.service and Before=nginx.service, so the per-VM credentials and TLS certificate are in place before the first page is ever served. It writes the credentials file at mode 0600 (root only) and drops a sentinel so it runs exactly once.

systemctl status bagisto-firstboot.service --no-pager | head -6
sudo stat -c '%a %U:%G %n' /root/bagisto-credentials.txt

First-boot service, systemd ordering and per-VM certificate

Administration from the CLI

Admin tasks use Laravel's artisan as the www-data user, for example to list the available commands:

sudo -u www-data php /var/www/bagisto/artisan list | head -30

Common operations include php artisan cache:clear, php artisan optimize (cache config and routes for production), and php artisan queue:work if you move email and indexing to a queue.

Enabling HTTPS with your own domain

The image already serves HTTPS with a per-VM self-signed certificate. For production, point a real domain at the VM's public IP, open 443/tcp in the NSG, then replace the self-signed certificate with a trusted one using Let's Encrypt (replace the domain):

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

After the certificate is issued, set the new address as the application URL in /var/www/bagisto/.env (APP_URL=https://your-domain.com), then sudo -u www-data php /var/www/bagisto/artisan optimize:clear.

Backup and maintenance

The database lives on the data disk at /var/lib/mysql and the application tree + uploaded media on the data disk at /var/www — snapshot both disks in Azure for a point-in-time backup, or dump the database with (the database password is in the credentials file):

sudo mariadb-dump bagisto > bagisto-backup.sql

Keep the OS patched with sudo apt update && sudo apt upgrade (unattended security upgrades are enabled by default). The stack restarts cleanly with sudo systemctl restart nginx php8.3-fpm mariadb.

Support

This image is backed by 24/7 cloudimg support. Contact us by email and chat for help with Bagisto deployment, upgrades, catalog and theme configuration, payment and shipping methods, multi-channel and multi-currency setup, REST and GraphQL API integration, performance tuning and database administration.

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.