How To Install Akaunting on Ubuntu 24.04 LTS
In this tutorial, we will show you how to install Akaunting on Ubuntu 24.04 LTS. Akaunting is a powerful, free, and open-source accounting software solution designed specifically for small businesses and freelancers. This comprehensive accounting platform offers essential features including invoicing, expense tracking, and detailed financial reporting capabilities, all through an intuitive web-based interface. With Ubuntu 24.04 LTS providing a stable, secure foundation for your business applications, combining these technologies creates an ideal setup for managing your financial operations efficiently.
This guide provides detailed, step-by-step instructions for installing Akaunting on Ubuntu 24.04 LTS. Whether you’re a business owner seeking a reliable accounting solution or a system administrator setting up financial tools for clients, this tutorial will walk you through the entire process from initial system preparation to post-installation configuration.
Prerequisites
Before beginning the installation process, ensure your system meets the following requirements:
- A server or computer running Ubuntu 24.04 LTS with at least 2GB RAM and 20GB storage
- Root access or a user account with sudo privileges
- Basic familiarity with Linux command-line operations
- A stable internet connection for downloading necessary packages
- A domain name pointed to your server (optional but recommended for production environments)
It’s highly recommended to start with a fresh installation of Ubuntu 24.04 LTS to avoid potential conflicts with existing software. This approach ensures a clean environment for your accounting system and minimizes troubleshooting issues later.
Updating Your Ubuntu 24.04 System
The first step in any installation process is ensuring your system is fully up-to-date. This guarantees you have the latest security patches and software versions before proceeding.
Open your terminal and execute the following commands:
sudo apt update
sudo apt upgrade -y
The first command refreshes your package lists, while the second upgrades all installed packages to their latest versions. The -y
flag automatically confirms the upgrade process without requiring manual intervention.
If prompted about service restarts during the upgrade, accept the default options unless you have specific requirements. After the update completes, you might want to install some essential utilities:
sudo apt install -y wget unzip curl software-properties-common
These tools will be necessary throughout the installation process for downloading and managing files.
Installing the LAMP Stack
Akaunting requires a LAMP (Linux, Apache, MySQL/MariaDB, PHP) stack to function properly. Let’s install each component separately.
Installing Apache Web Server
Apache is a reliable, secure web server that will host your Akaunting application. Install it with:
sudo apt install apache2 -y
After installation, enable and start the Apache service:
sudo systemctl enable --now apache2
This command both enables Apache to start automatically at boot and starts it immediately. Verify installation by accessing your server’s IP address in a web browser. You should see the default Apache page.
Installing MariaDB Server
MariaDB will store all your accounting data securely. Install it using:
sudo apt install mariadb-server -y
Once installed, secure your MariaDB installation:
sudo mysql_secure_installation
Follow the prompts to:
- Set a root password (recommended)
- Remove anonymous users (answer “Y”)
- Disallow root login remotely (answer “Y”)
- Remove test database (answer “Y”)
- Reload privilege tables (answer “Y”)
These security measures protect your financial data from unauthorized access.
Installing PHP and Required Extensions
Akaunting requires PHP and several extensions to function properly. Install them with:
sudo apt install php php-cli php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-bcmath php-intl php-imagick -y
For optimal performance with Ubuntu 24.04, you’ll likely be working with PHP 8.2 or newer, which is fully compatible with Akaunting.
Verify PHP installation with:
php -v
This displays your PHP version and confirms successful installation.
Creating a Database for Akaunting
Now we’ll create a dedicated database and user for Akaunting. Access the MariaDB console:
sudo mysql -u root -p
Enter your MariaDB root password when prompted. Then execute these SQL commands:
CREATE DATABASE akauntingdb;
CREATE USER 'akaunting'@'localhost' IDENTIFIED BY 'YourStrongPassword';
GRANT ALL ON akauntingdb.* TO 'akaunting'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Replace ‘YourStrongPassword’ with a secure password of your choice. This creates:
- A dedicated database named “
akauntingdb
“ - A database user named “
akaunting
“ - Appropriate permissions for this user to manage the database
Keeping a secure record of these database credentials is crucial, as you’ll need them during the web installation process.
Downloading and Installing Akaunting
With our environment prepared, let’s download and install Akaunting:
cd /var/www/html
wget -O Akaunting.zip https://akaunting.com/download.php?version=latest
This downloads the latest stable version of Akaunting directly from the official website. Next, extract the files:
sudo unzip Akaunting.zip
sudo rm Akaunting.zip
Now set proper ownership and permissions for security and functionality:
sudo chown -R www-data:www-data /var/www/html
sudo find /var/www/html -type d -exec chmod 755 {} \;
sudo find /var/www/html -type f -exec chmod 644 {} \;
These commands ensure:
- The web server has appropriate access to the application files
- Directories have the correct 755 permissions
- Files have the correct 644 permissions
This permission structure balances security and functionality, allowing the web server to operate while preventing unauthorized access.
Configuring Apache Virtual Host
Create a dedicated Apache virtual host configuration for Akaunting:
sudo nano /etc/apache2/sites-available/akaunting.conf
Add the following configuration, modifying the domain to match your setup:
<VirtualHost *:80>
ServerAdmin webmaster@yourdomain.com
DocumentRoot /var/www/html
ServerName yourdomain.com
ServerAlias www.yourdomain.com
<Directory /var/www/html>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/akaunting_error.log
CustomLog ${APACHE_LOG_DIR}/akaunting_access.log combined
</VirtualHost>
If you’re using a local installation without a domain, replace yourdomain.com with your server’s IP address.
Save and close the file (Ctrl+X, then Y, then Enter). Enable the new configuration and required modules:
sudo a2ensite akaunting.conf
sudo a2enmod rewrite
sudo a2dissite 000-default.conf
sudo systemctl restart apache2
These commands:
- Enable your Akaunting virtual host
- Enable the rewrite module required for clean URLs
- Disable the default Apache site
- Restart Apache to apply changes
Securing Your Akaunting Installation
Setting Up SSL/TLS with Let’s Encrypt
For production environments, securing your Akaunting installation with HTTPS is essential. Install Certbot for Let’s Encrypt certificates:
sudo apt install certbot python3-certbot-apache -y
Obtain and configure an SSL certificate:
sudo certbot --apache -d yourdomain.com -d www.yourdomain.com
Follow the prompts to complete the certificate installation. Certbot automatically configures Apache to use the new certificate and sets up automatic renewal.
Firewall Configuration
Configure Ubuntu’s firewall to allow necessary traffic:
sudo ufw allow 'Apache Full'
sudo ufw allow ssh
sudo ufw enable
Verify the firewall status:
sudo ufw status
This configuration allows HTTP, HTTPS, and SSH traffic while blocking other incoming connections for enhanced security.
Security Best Practices
Implement these additional security measures:
- Regularly update your system with
sudo apt update && sudo apt upgrade
- Consider implementing fail2ban to prevent brute force attacks
- Remove unnecessary services and packages from your server
- Configure regular database backups
These practices significantly enhance your installation’s security posture, protecting sensitive financial data.
Completing the Akaunting Web Installation
Accessing the Web Installer
With all server-side preparations complete, access the Akaunting web installer by navigating to your domain or server IP in a web browser:
https://yourdomain.com
You’ll be greeted with the Akaunting installation wizard.
Language and Database Configuration
In the installation wizard:
- Select your preferred language from the dropdown menu and click “Next”
- Enter the database information you configured earlier:
- Database Host: localhost
- Database Port: 3306 (default)
- Database Name: akauntingdb
- Database Username: akaunting
- Database Password: YourStrongPassword
- Click “Next” to proceed
If you encounter any connection errors, verify your database credentials and ensure the MariaDB service is running.
Company Setup
Enter your company information:
- Company Name: Your business name
- Company Email: Your business email
- Company Tax Number: Your tax ID (if applicable)
- Company Address: Your business address
- Currency: Select your primary operating currency
- Time Zone: Your local time zone
This information will appear on invoices and financial reports.
Admin Account Creation
Create your administrator account:
- Admin Email: Your administrative email address
- Admin Password: A strong, unique password
For security, use a complex password combining uppercase letters, lowercase letters, numbers, and special characters. Store this password securely, as it provides full access to your accounting system.
Click “Next” to complete the installation. You’ll be redirected to the login page where you can enter your admin credentials to access the dashboard.
Post-Installation Configuration
After logging in, take some time to configure these essential settings:
Basic Settings
- Navigate to Settings → General
- Verify company information
- Configure financial year settings
- Set default payment terms
Tax Rates
- Go to Settings → Tax Rates
- Add applicable tax rates for your jurisdiction
- Configure default taxes for products and services
Categories
- Access Settings → Categories
- Create income and expense categories reflecting your business operations
- Set up appropriate account mappings
Users and Permissions
- Navigate to Settings → Users
- Add additional users as needed
- Configure role-based permissions
Taking time to properly configure these settings ensures your accounting system accurately reflects your business structure and requirements.
Troubleshooting Common Installation Issues
Database Connection Problems
- Error: “Could not connect to database”
- Solution: Verify database credentials, ensure MariaDB is running with
sudo systemctl status mariadb
Permission Issues
- Error: “Permission denied” or inability to save changes
- Solution: Check directory ownership and permissions with:
sudo chown -R www-data:www-data /var/www/html sudo find /var/www/html -type d -exec chmod 755 {} \; sudo find /var/www/html -type f -exec chmod 644 {} \;
PHP Extension Errors
- Error: “Required PHP extension missing”
- Solution: Install missing extensions with:
sudo apt install php-[extension_name]
And restart Apache:
sudo systemctl restart apache2
Memory Limits
- Error: “Allowed memory size exhausted”
- Solution: Edit PHP configuration:
sudo nano /etc/php/8.2/apache2/php.ini
Find and increase
memory_limit
parameter, then restart Apache
These troubleshooting steps address the most common issues encountered during installation, allowing you to resolve problems quickly and efficiently.
Maintenance and Updates
Maintaining your Akaunting installation ensures security, performance, and access to the latest features.
Regular Backups
Implement a backup strategy:
# Database backup
sudo mysqldump -u root -p akauntingdb > akaunting_backup_$(date +%Y%m%d).sql
# File backup
sudo tar -czf akaunting_files_$(date +%Y%m%d).tar.gz /var/www/html
Store these backups securely, preferably off-site or in cloud storage.
Updating Akaunting
Before updating:
- Create full backups as described above
- Check the Akaunting release notes for breaking changes
For updates:
- Download the latest version
- Extract the new files over the existing installation
- Update permissions as needed
- Run database migrations through the web interface
Performance Optimization
For improved performance:
- Enable PHP OPcache
- Consider implementing a caching solution
- Optimize your database regularly:
sudo mysqlcheck -o akauntingdb -u root -p
Regular maintenance ensures your accounting system remains secure, efficient, and reliable for your business operations.
Congratulations! You have successfully installed Akaunting. Thanks for using this tutorial for installing Akaunting on Ubuntu 24.04 LTS system. For additional help or useful information, we recommend you check the Akaunting website.