Installing Akaunting on Ubuntu 16.04

Published on: Fri, Aug 3, 2018 at 11:17 am EST
Business Linux Guides Server Apps Ubuntu

Akaunting is a free, open source and online accounting software designed for small businesses and freelancers. It is built with modern technologies such as Laravel, Bootstrap, jQuery and RESTful API. Akaunting's source is on GitHub. This guide will show you how to install Akaunting on a fresh Ubuntu 16.04 Vultr instance.

Requirements

  • PHP 5.6.4 or higher with the following PHP extensions:
    • PDO
    • OpenSSL
    • Mbstring
    • Tokenizer
    • XML
    • Zip
    • cURL
  • MySQL
  • Nginx

Check the Ubuntu version.

lsb_release -ds
# Ubuntu 16.04.4 LTS

Create a new non-root user account with sudo access and switch to it.

adduser johndoe --gecos "John Doe"
usermod -aG sudo johndoe
su - johndoe

NOTE: Replace johndoe with your username.

Set up the timezone.

sudo dpkg-reconfigure tzdata

Ensure that your system is up to date.

sudo apt update && sudo apt upgrade -y

Install build-essential and unzip.

sudo apt install -y build-essential unzip

Install PHP and required PHP extensions

Install PHP and necessary PHP extensions.

sudo apt install -y php7.0 php7.0-cli php7.0-fpm php7.0-mbstring php7.0-mysql php7.0-common php7.0-zip php7.0-curl php7.0-xml

Check the version.

php -v

Install MySQL

Install MySQL.

sudo apt install -y mysql-server

Check the version.

mysql --version

Run the mysql_secure installation script to improve MySQL's security.

sudo mysql_secure_installation

Connect to the MySQL shell as the root user.

mysql -u root -p
# Enter password:

Create an empty MySQL database and user for Akaunting, and remember the credentials.

CREATE DATABASE dbname;
GRANT ALL ON dbname.* TO 'username' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT;

Install Nginx

Install Nginx.

sudo apt install -y nginx

Check the version.

sudo nginx -v

Configure Nginx for Akaunting. Run sudo vim /etc/nginx/sites-available/akaunting.conf and add the following configuration.

server {
    listen 80;
    listen [::]:80;

    server_name example.com;

    root /var/www/akaunting;

    index index.php index.html;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_index index.php;
        try_files $uri =404;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }
}

Activate the new akaunting.conf configuration by linking the file to the sites-enabled directory.

sudo ln -s /etc/nginx/sites-available/akaunting.conf /etc/nginx/sites-enabled/

Test the configuration.

sudo nginx -t

Reload Nginx.

sudo systemctl reload nginx.service

Install Akaunting

Create a document root directory.

sudo mkdir -p /var/www/akaunting

Change ownership of the /var/www/akaunting directory to johndoe.

sudo chown -R johndoe:johndoe /var/www/akaunting

Download the latest stable Akaunting software and unzip it.

cd /var/www/akaunting
curl -O -J -L https://akaunting.com/download.php?version=latest
unzip Akaunting_1.1.15-Stable.zip
rm Akaunting_1.1.15-Stable.zip

Change ownership of the /var/www/akaunting directory to www-data.

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

Launch the installer by opening your domain name/IP address in your web browser and fill in the required information. After that, Akaunting software will be installed on your server.

Want to contribute ?

You could earn up to $300 by adding new articles