Akaunting is a popular open-source and self-hosted accounting software application designed specifically for small businesses and freelancers. Built using Laravel, Bootstrap, jQuery, and RESTful API, Akaunting provides a comprehensive platform for creating and managing invoices, quotes, and finances through a web browser interface. Moreover, it offers an extensive App Store where users and developers can enhance the functionality of Akaunting. In this tutorial, we will guide you through the process of installing Akaunting with Apache and Let’s Encrypt SSL on Ubuntu 22.04, ensuring a secure and efficient accounting solution for your business.
Prerequisites
Before diving into the installation process, make sure you have the following prerequisites in place:
- A server running Ubuntu 22.04.
- A valid domain name pointing to your server’s IP address.
- A root password configured on the server.
Step 1: Install Apache, MariaDB, and PHP
The first step is to install Apache, MariaDB, PHP, and other necessary PHP extensions on your Ubuntu 22.04 server. To install these packages, run the following command in your terminal:
apt-get install apache2 mariadb-server php libapache2-mod-php php-common php-imap php-mbstring php-xmlrpc php-soap php-gd php-xml php-intl php-mysql php-cli php-bcmath php-ldap php-zip php-curl unzip curl -y
Once the installation is complete, you need to edit the PHP configuration file to adjust the default settings. Open the file using the command:
nano /etc/php/8.1/apache2/php.ini
Within this file, modify the following lines:
memory_limit = 256M upload_max_filesize = 16M post_max_size = 16M max_execution_time = 300 date.timezone = UTC
Save and close the file. To apply the changes, restart the Apache service:
systemctl restart apache2
Step 2: Configure MariaDB Database
Akaunting relies on MariaDB/MySQL as its database backend. Therefore, you need to create a database and a user specifically for Akaunting. To do this, follow the steps below:
- Log in to the MariaDB shell by entering the following command:
mysql -u root -p
- Once logged in, create a new database for Akaunting:
CREATE DATABASE akaunting_db;
- Next, create a user with the necessary privileges for the Akaunting database:
CREATE USER 'akaunting_user'@'localhost' IDENTIFIED BY 'password';
Remember to replace 'password'
with a strong password of your choice.
- Grant all privileges to the Akaunting user for the created database:
GRANT ALL ON akaunting_db.* TO 'akaunting_user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
Again, replace 'password'
with the password you set for the user.
- Flush the privileges and exit the MariaDB shell:
FLUSH PRIVILEGES; EXIT;
Step 3: Install Akaunting
Now that the necessary prerequisites are in place and the database is configured, you can proceed with installing Akaunting. Follow the steps below:
- Visit the official Akaunting download page and obtain the latest version using the following command:
wget -O Akaunting.zip https://akaunting.com/download.php?version=latest
- After the download is complete, unzip the downloaded file and move it to the Apache web root directory:
mkdir -p /var/www/html/akaunting unzip Akaunting.zip -d /var/www/html/akaunting
- Change the ownership and permissions of the Akaunting directory to ensure proper access:
chown -R www-data:www-data /var/www/html/akaunting chmod -R 755 /var/www/html/akaunting
With these steps complete, you are ready to configure Apache for Akaunting.
Step 4: Configure Apache for Akaunting
To ensure smooth operation of Akaunting, you need to create a virtual host configuration file for Apache. Follow the steps below:
- Create a new Apache configuration file for Akaunting:
nano /etc/apache2/sites-available/akaunting.conf
- Within this file, add the following lines:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/akaunting
ServerName akaunting.example.com
DirectoryIndex index.html index.php
<Directory /var/www/html/akaunting/>
Options +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/akaunting_error.log
CustomLog ${APACHE_LOG_DIR}/akaunting_access.log combined
</VirtualHost>
- Save and close the file. Next, activate the newly created virtual host and enable the Apache rewrite module:
a2ensite akaunting a2enmod rewrite
- Finally, restart the Apache service to apply the changes:
systemctl restart apache2
You can verify the status of the Apache service by running the following command:
systemctl status apache2
Step 5: Secure Akaunting with Let’s Encrypt SSL
To ensure secure communication with your Akaunting installation, it is recommended to enable Let’s Encrypt SSL. Follow the steps below to set up SSL for your Akaunting website:
- Install the Certbot client and the Apache plugin using the following command:
apt-get install certbot python3-certbot-apache -y
- Once the installation is complete, secure your website with Let’s Encrypt SSL by running the following command:
certbot --apache -d akaunting.example.com
You will be prompted to provide your email address and agree to the terms of service. Follow the instructions on the screen to complete the SSL installation.
- After the installation is complete, you will have a valid SSL certificate for your Akaunting website. You can verify the SSL configuration using the SSL Labs test provided by Qualys at https://www.ssllabs.com/ssltest/analyze.html?d=akaunting.example.com.
With SSL enabled, your Akaunting installation is now secure and ready for use.
Step 6: Access the Akaunting Web Interface
Now that you have successfully installed and secured Akaunting, you can access the web interface to set up your accounting system. Follow the steps below:
- Open your web browser and enter the URL for your Akaunting installation (e.g., http://akaunting.example.com).
- On the Akaunting welcome screen, select your preferred language and click on the “Next” button.
- In the database configuration screen, provide the database details you set up earlier (database name, username, and password). Click on the “Next” button to proceed.
- On the Admin user account creation screen, enter your company name, email address, and choose a strong password for the admin account. Click on the “Next” button to continue.
- You will be redirected to the Akaunting login screen. Enter your admin username and password to access the Akaunting dashboard.
- On the subsequent screens, you can customize your accounting system by enabling currencies, installing plugins, and configuring additional settings according to your requirements.
Congratulations! You have successfully installed Akaunting with Apache and Let’s Encrypt SSL on your Ubuntu 22.04 server. You now have a powerful accounting software solution at your fingertips to manage your invoices, quotes, and finances efficiently. If you have any questions or need further assistance, feel free to reach out to us.
For reliable and scalable cloud hosting solutions tailored to your business needs, consider Shape.host’s Cloud VPS services. Shape.host offers a wide range of hosting options to ensure optimal performance and security for your applications. Visit Shape.host today to explore our hosting solutions and take your business to new heights.