Deployment Overview of Akaunting on Server¶
Prerequisites and Basic Requirements¶
To ensure a successful deployment, the server must meet the following requirements:
-
Operating System: Ubuntu (latest stable release).
-
Privileges: Root or sudo access is required for all installation steps.
-
Ports: The following ports must be open in the firewall:
-
22(SSH) -
80(HTTP) -
443(HTTPS) -
Dependencies: The system requires Git, Docker, Docker Compose V2, Nginx, MySQL Server, and PHP 8.3 with various extensions.
FQDN of the final panel on the hostkey.in domain¶
The application is accessible via a specific subdomain template based on the server ID.
| Parameter | Value |
|---|---|
| Prefix | akaunting |
| Domain | hostkey.in |
| Full template | akaunting{Server_ID}.hostkey.in |
File and Directory Structure¶
The application and its configuration files are organized as follows:
-
Application Root:
/opt/akaunting -
Environment Configurations:
/opt/akaunting/env/(containsdb.envandrun.env) -
Certbot Data:
/opt/akaunting/data/certbot/confand/opt/akaunting/data/certbot/www -
Nginx Configuration:
/etc/nginx/sites-available/akaunting
Application Installation Process¶
The installation follows a multi-stage process involving system dependency setup, source code retrieval, and container orchestration:
-
System Dependency Setup:
-
The
universerepository is enabled. -
Core packages including
docker.io,nginx,mysql-server, andcertbotare installed. -
PHP 8.3 is installed along with essential modules (
php8.3-fpm,php8.3-mysql,php8.3-curl,php8.3-gd,php8.3-xml,php8.3-mbstring,php8.3-intl,php8.3-gmp,php8.3-bcmath, andphp8.3-zip). -
IonCube Loader: The IonCube Loader is downloaded, extracted, and configured as a PHP extension for both FPM and CLI environments to support encrypted files.
-
Composer & Node.js: Composer is installed globally, and Node.js 18 is added via the official NodeSource repository.
-
Source Code Retrieval:
-
The application source code is cloned from the official Akaunting Docker repository into
/opt/akauntingusinggit. -
Container Orchestration:
-
Environment files (
db.envandrun.env) are generated in/opt/akaunting/env/. -
The application is started using
docker compose up --detachfrom the installation directory. -
Web Server & SSL Configuration:
-
Nginx is configured as a reverse proxy for the application.
-
Certbot is used to obtain an SSL certificate via the
--nginxplugin. -
Once the certificate is obtained, Nginx is reconfigured to enforce HTTPS and redirect all HTTP traffic to secure connections.
Access Rights and Security¶
-
Firewall: The Uncomplicated Firewall (UFW) is enabled with rules allowing incoming traffic on ports
22,80, and443. -
Permissions: Configuration files in
/etc/nginx/sites-available/are owned byrootwith0644permissions.
Databases¶
The application uses a MySQL database managed via Docker containers.
| Parameter | Value |
|---|---|
| Database Name | akaunting |
| Database User | admin |
| Connection Host | akaunting-db (Docker internal network) |
| Port | 3306 |
Docker Containers and Their Deployment¶
The application is deployed using Docker Compose. The following containers are managed:
Akaunting Application Container¶
-
Image: Derived from the cloned repository.
-
Ports: Internal port
8080(mapped via Nginx proxy). -
Environment Variables: Loaded from
/opt/akaunting/env/run.env. -
Restart Policy: Managed by Docker Compose.
Database Container¶
-
Image: MySQL/MariaDB image.
-
Network: Connected to the application network.
-
Environment Variables: Configured via
/opt/akaunting/env/db.env.
Custom Scripts and Additional Setup¶
The deployment includes several automated configuration steps:
-
Environment Generation: Automated creation of
db.envfor database credentials andrun.envfor application settings (including production mode and SSL URL). -
Nginx Proxy Chain: A two-stage Nginx setup is used. First, a temporary configuration allows the Certbot challenge to pass through port 80. Once SSL is active, a final configuration is applied that enforces TLS 1.2/1.3 and proxies traffic to the container on
localhost:8080.
Application Update Instructions¶
To update the main application, navigate to the installation directory and run the following command:
Location of Configuration Files and Data¶
-
Main App Config:
/opt/akaunting/env/run.env -
Database Config:
/opt/akaunting/env/db.env -
Nginx Site Config:
/etc/nginx/sites-available/akaunting -
SSL Certificates:
/etc/letsencrypt/live/{your_domain}/
Available Ports for Connection¶
-
HTTPS (Secure Web Access):
443 -
HTTP (Redirect to HTTPS):
80 -
SSH (Remote Management):
22
Starting and Stopping the Application¶
The application is managed via Docker Compose from the installation directory:
-
Start the application:
-
Stop the application:
-
Restart the application:
Proxy Servers¶
The system uses Nginx as a reverse proxy server. It handles SSL termination via Certbot (Let's Encrypt) and forwards all requests to the Akaunting container running on port 8080. The configuration includes strict security headers and enforces HTTPS redirection for all incoming traffic.