Installing Akaunting on Debian 11

Introduction

Akaunting is a free, open-source accounting software based on PHP, used to manage financial-related tasks in a business, such as tracking invoices, payments, and expenses. It can be installed on a cloud server or your personal computer, and it’s suitable for small businesses. Some important features are:

  • Create, track, and manage unlimited bank and cash accounts.
  • Manage finances from multiple companies.
  • Detailed financial reporting using graphs for managerial decisions.
  • Client portal for sharing transactions and bulk online payments.
  • Task automation for major jobs that span long durations.
  • Multi-currency support.
  • Discount management system.

This article guides you on how to install Akaunting on Debian 11.0 server.

Prerequisites

Perform the following steps first:

  • Deploy a Vultr Debian 11.0 Server.
  • Connect to the server with SSH.
  • Update the server.
  • Create a non-root user with sudo access.
  • PHP 7.3 or higher.
  • Database (eg: MySQL, PostgreSQL, SQLite, SQL Server).

1. Setup LAMP Stack

Update the system package list.

$ sudo apt update

Install PHP 7.4, Apache2, MariaDB server, and other required modules.

$ sudo apt install apache2 mariadb-server php7.4 libapache2-mod-php7.4 php7.4-json php7.4-common php7.4-gmp php7.4-curl php7.4-mysql php7.4-intl php7.4-sqlite3 php7.4-bcmath php7.4-mbstring php7.4-xmlrpc php7.4-gd php7.4-cli php7.4-xml php7.4-zip php7.4-imap wget unzip -y

2. Setup Akaunting Database

Enable the database server to start automatically on a reboot.

$ sudo systemctl enable mysql

Verify the status of the database server.

$ sudo systemctl status mysql

Run mysql_secure installation script to set up MySQL security. This helps you prevent remote logins to your database server.

$ sudo mysql_secure_installation

When prompted, answer the questions as shown below:

  • Enter current password for root (enter for none): Press ENTER.
  • Switch to unix_socket authentication? Press N, then ENTER.
  • Change the root password? Press Y, then ENTER.
  • Remove anonymous users? Press Y, then ENTER.
  • Disallow root login remotely? Press Y, then ENTER.
  • Remove test database and access to it? Press Y, then ENTER.
  • Reload privilege tables now? Press Y, then ENTER.

Log in to MySQL shell. At the prompt, enter your password to continue.

$ sudo mysql -u root -p

Create a database called akaunting. You can change the name to a preferred one.

CREATE DATABASE akaunting;

Create a database user called akauntinguser with a password StrongPassword. Modify the value StrongPassword with your own secure password.

CREATE USER 'akauntinguser'@'localhost' IDENTIFIED BY 'StrongPassword';

Grant the user full access to the database.

GRANT ALL ON akaunting.* TO 'akauntinguser'@'localhost' WITH GRANT OPTION;

Save the changes made to the database.

FLUSH PRIVILEGES;

Exit MySQL shell.

exit;

3. Install Akaunting

Download the latest version of Akaunting.

$ wget -O Akaunting.zip https://akaunting.com/download.php?version=latest

Create installation directory /var/www/akaunting/ in the webroot.

$ sudo mkdir -p /var/www/akaunting/

Extract the downloaded zipped archive into the installation directory.

$ sudo unzip Akaunting.zip -d /var/www/akaunting/

Set the ownership of the directory to the webroot user and group.

$ sudo chown www-data:www-data -R /var/www/akaunting/

Change the access permissions.

$ sudo chmod -R 755 /var/www/akaunting/

4. Configure Apache2

Enable the Apache service to start automatically on a reboot.

$ sudo systemctl enable apache2

Verify the status of the Apache service.

$ sudo systemctl status apache2

Create a new Apache configuration file called akaunting.conf.

$ sudo nano /etc/apache2/sites-available/akaunting.conf

Copy and paste the code below, then save and exit the file.

<VirtualHost *:80>

    ServerAdmin localhost
    DocumentRoot /var/www/akaunting/
    ServerName example.com
    ServerAlias www.example.com

    <Directory /var/www/akaunting/>
        DirectoryIndex index.php
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Disable Apache default configuration file.

$ sudo a2dissite 000-default.conf

Enable Akaunting Apache configuration file.

$ sudo a2ensite akaunting.conf

Enable Apache rewrite mode.

$ sudo a2enmod rewrite

Allow firewall through port 80.

$ sudo ufw allow 80/tcp

Restart Apache service.

$ sudo systemctl restart apache2

5. Access Akaunting Web Interface

To access the Akaunting Web Interface, go to your browser and visit http://Server_IP/. For example:

http://192.0.2.10/

Conclusion

You have installed Akaunting on Debian 11 server. On the web interface you accessed, continue with the installation process by creating an administrator account, and connecting to your database using the credentials you used. To learn more about accounting, visit website official documentation.

Leave a Comment