---
title: "Deploy Akaunting"
description: "Open-source accounting with MariaDB and persistent business data."
category: "Other"
url: https://railway.com/deploy/akaunting-1
---

# Deploy Akaunting

Open-source accounting with MariaDB and persistent business data.

**[Deploy Akaunting on Railway](https://railway.com/template/akaunting-1)**

- **Creator:** Agaz Self-Host
- **Category:** Other

## Template content

### MariaDB

- **Image:** mariadb:11.8.2@sha256:2bcbaec92bd9d4f6591bc8103d3a8e6d0512ee2235506e47a2e129d190444405

### Akaunting

- **Image:** akaunting/akaunting:3.1.21@sha256:918bbc77981e5b96ab6aa6838491cfa7c98cb4ee7bbf9532ee083e7e66d04255
- **Start command:** `bash -c "a2dismod mpm_event mpm_worker 2>/dev/null || true; a2enmod mpm_prefork >/dev/null 2>&1 || true; a2enmod rewrite >/dev/null 2>&1 || true; mkdir -p /var/www/html/storage/framework/sessions /var/www/html/storage/framework/views /var/www/html/storage/framework/cache /var/www/html/storage/app/uploads /var/www/html/bootstrap/cache; if [ \"\$(php -r 'try{\$p=new PDO(\"mysql:host=\".getenv(\"DB_HOST\").\";port=\".getenv(\"DB_PORT\").\";dbname=\".getenv(\"DB_NAME\"),getenv(\"DB_USERNAME\"),getenv(\"DB_PASSWORD\"));\$c=\$p->query(\"SELECT COUNT(*) FROM \".getenv(\"DB_PREFIX\").\"users\")->fetchColumn();echo \$c>0?\"yes\":\"no\";}catch(Exception \$e){echo \"no\";}')\" != \"yes\" ]; then echo INSTALL_BRANCH; retry_for=30; while sleep 5; do if php artisan install --db-host=\"\$DB_HOST\" --db-port=\"\$DB_PORT\" --db-name=\"\$DB_NAME\" --db-username=\"\$DB_USERNAME\" \"--db-password=\$DB_PASSWORD\" --db-prefix=\"\$DB_PREFIX\" \"--company-name=\$COMPANY_NAME\" \"--company-email=\$COMPANY_EMAIL\" \"--admin-email=\$ADMIN_EMAIL\" \"--admin-password=\$ADMIN_PASSWORD\" \"--locale=\$LOCALE\" --no-interaction; then break; fi; retry_for=\$((retry_for-5)); if [ \$retry_for -le 0 ]; then echo \"Unable to find database!\" >&2; exit 1; fi; done; else echo SERVE_BRANCH; if ! grep -q \"^APP_INSTALLED=true\" /var/www/html/.env; then sed -i \"s/^APP_INSTALLED=false/APP_INSTALLED=true/\" /var/www/html/.env || echo \"APP_INSTALLED=true\" >> /var/www/html/.env; fi; fi; chown -R www-data:root /var/www/html/storage /var/www/html/bootstrap/cache; chmod -R u=rwX,g=rX,o=rX /var/www/html/storage /var/www/html/bootstrap/cache; exec docker-php-entrypoint apache2-foreground"`
- **Health check:** /auth/login
- **Public domain:** Yes

## Documentation

# Deploy and Host Akaunting on Railway

## What is Akaunting?

Akaunting is open-source accounting software for small businesses and
freelancers. It provides invoicing, expense tracking, banking, reporting, and
multi-company bookkeeping through a browser-based interface.

## About Hosting Akaunting

This template deploys exactly two services: Akaunting and MariaDB. Akaunting
uses `akaunting/akaunting:3.1.21@sha256:918bbc77981e5b96ab6aa6838491cfa7c98cb4ee7bbf9532ee083e7e66d04255`,
and MariaDB uses
`mariadb:11.8.2@sha256:2bcbaec92bd9d4f6591bc8103d3a8e6d0512ee2235506e47a2e129d190444405`.
Railway provides the public HTTPS endpoint for Akaunting while MariaDB remains
on private networking. Only MariaDB has a persistent volume, mounted at
`/var/lib/mysql`; Akaunting has no volume mount. Shared credentials are
generated once and passed through Railway service references. The deployer
supplies only the initial administrator email and password.

## Common Use Cases

* Send invoices and track customer payments.
* Record expenses, bills, banking activity, and transfers.
* Run reports and maintain books for one or more small businesses.

## Dependencies for Akaunting Hosting

* `akaunting/akaunting:3.1.21@sha256:918bbc77981e5b96ab6aa6838491cfa7c98cb4ee7bbf9532ee083e7e66d04255`.
* `mariadb:11.8.2@sha256:2bcbaec92bd9d4f6591bc8103d3a8e6d0512ee2235506e47a2e129d190444405` on Railway private networking.
* One persistent volume mounted at `/var/lib/mysql` for MariaDB; Akaunting has
  no volume mount.

### Deployment Dependencies

* [Akaunting source](https://github.com/akaunting/akaunting)
* [Official Akaunting Docker packaging](https://github.com/akaunting/docker)
* [Akaunting installation documentation](https://akaunting.com/hc/docs/on-premise-app/install-update/)

### Implementation Details

The Akaunting service listens on public port `80`. Railway routes HTTPS to that
port and checks `/auth/login` for application health. MariaDB is private-only
and persists its database files at `/var/lib/mysql`.

The Akaunting service reaches MariaDB through
`${{MariaDB.RAILWAY_PRIVATE_DOMAIN}}`. MariaDB owns the authoritative generated
database password; Akaunting references it without copying a literal value. The
application signing key is generated once on Akaunting.

Because Akaunting has no volume mount, files written only to its container
filesystem are outside this template's persistence guarantee and should not be
assumed durable across container replacement. MariaDB data is persistent only
through the volume mounted at `/var/lib/mysql`.

Before updating, back up the MariaDB volume, separately export any required
Akaunting container-local files, review Akaunting and MariaDB release notes, and
validate the replacement immutable image digests in isolation. If a database
migration is incompatible, restore a MariaDB backup that matches the prior
application and database pins; rolling back only the Akaunting image may not
reverse a database migration.

This community template is maintained independently and does not imply
affiliation with or endorsement by Akaunting.

## Why Deploy Akaunting on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Akaunting on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — [Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/akaunting-1
