×
Community Blog How to Install Akaunting on CentOS and Ubuntu

How to Install Akaunting on CentOS and Ubuntu

In this tutorial, we will be installing and configuring Alfresco Community Edition on an Alibaba Cloud Elastic Compute Service (ECS) instance with CentOS 7.

By Arslan Ud Din Shafiq, Alibaba Cloud Tech Share Author. Tech Share is Alibaba Cloud's incentive program to encourage the sharing of technical knowledge and best practices within the cloud community.

Akaunting is an open source software related to online accounting for businesses. It is free to use, and you can access it from any device. You can run your business, check your finance reports, and even get information about your cash flow at any time through its various tools. Akaunting is developed in Laravel (PHP framework), Bootstrap (CSS framework), jQuery and some RESTful APIs. It is available on GitHub and is available in 28 languages.

In this tutorial, we will be installing Akaunting on an Alibaba Cloud Elastic Compute Service (ECS) with Linux. I will be showing the steps for both Ubuntu 16.04 and CentOS 7 as they are quite similar.

Prerequisites

  1. You must have Alibaba Cloud Elastic Compute Service (ECS) activated and verified your valid payment method. If you are a new user, you can get a free account in your Alibaba Cloud account. If you don't know about how to setup your ECS instance, you can refer to this tutorial or quick-start guide. Your ECS instance must have at least 1GB RAM and 1 Core processor.
  2. A domain name registered from Alibaba Cloud. If you have already registered a domain from Alibaba Cloud or any other host, you can update its domain nameserver records.
  3. Domain name must be pointed to your Alibaba Cloud ECS's IP address
  4. Access to VNC console in your Alibaba Cloud or SSH client installed in your PC
  5. Set up your server's hostname and create user with root privileges.

Before proceeding with installation of any kind of package, use the following command to update your system. To execute this command, remember to login from non-root user with sudo privileges.

For Ubuntu

# sudo apt update && sudo apt upgrade

For CentOS

# sudo yum update -y

Basic Setup

Install unzip

You will be required to unzip the compressed zip folder of Akaunting, for this purpose, you will have to install unzip.

For Ubuntu

# sudo apt-get install unzip

For CentOS

# sudo yum install unzip -y

Install build-essential

Some essentials are required for installing and setting up Akaunting. Follow the steps below for build-essential.

For Ubuntu

# sudo apt install build-essential

Install EPEL repository

To install EPEL repository, execute the following command.

For CentOS

# sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 

Install Webstatic Yum Repository

To install webstatic YUM repository, execute the following command.

For CentOS

# sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Install PHP

PHP is a server-side scripting language. To install PHP, execute the following command.

For Ubuntu

# sudo apt install -y php7.0

For CentOS

# sudo yum install -y php72w

Install PHP Extensions

For installation of Akaunting, some PHP extensions are required. The required extensions include php-cli, php-fpm, php-mbstring, php-mysql, php-common, php-zip, php-curl and php-xml. To install these extensions, execute the following command.

For Ubuntu

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

For CentOS

# sudo yum install -y php72w-cli php72w-fpm php72w-common php72w-mbstring php72w-xml php72w-mysql php72w-pgsql php72w-sqlite3 php72w-zip php72w-curl

Check the Installation of PHP

To check PHP version and installation of PHP, execute the command below.

# php -v

1

Install MySQL Server

Akaunting requires MySQL database. To install MySQL, execute the command below.

For Ubuntu

# sudo apt install -y mysql-server

Set a password for your MySQL server and secure the installation with the following command.

# sudo mysql_secure_installation

For Ubuntu

# sudo yum install -y mariadb-server

Now start and enable MariaDB server, so that on reboot, MariaDB can restart automatically.

# sudo systemctl enable mariadb
# sudo systemctl start mariadb

Set password for your MySQL server and secure the installation with the following command.

# sudo mysql_secure_installation

Configure Database

In this section, you will have to create a database, add a user, setup its credentials and assign database to user. To do so, login to MySQL shell.

# mysql -u root -p

Now execute the following query to create database, username and assign database.

CREATE DATABASE ak;
GRANT ALL ON ak.* TO 'ak' IDENTIFIED BY '654321Ab';
FLUSH PRIVILEGES;
EXIT;

Install Nginx Server

You will be required to install an Nginx server. For this purpose, you will need to follow the steps below.

For Ubuntu

To install, execute the command

# sudo apt-get install nginx

After successful installation, you will see the screen below.

2

For CentOS

To install execute the command

# sudo yum -y install nginx

After successful installation, you will see the screen below.

3

For Ubuntu and CentOS

Now you will need to start Nginx server by executing command below.

# sudo systemctl start nginx

To check status of Nginx server, execute the command below.

# sudo systemctl status nginx

To check the installation, access IP address of your Alibaba Cloud ECS or your domain name that you have pointed to your IP address. In my case, I have accessed via domain name and the following screen loaded.

4

To check current version of nginx, execute the command below.

# sudo nginx -v

Configure Nginx Server

Create configuration file in available sites for Akaunting. To do so, execute the command below.

For Ubuntu

# sudo nano /etc/nginx/sites-available/akaunting.conf

Now add the following text to the opened file.

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

    server_name softpedia.xyz;
    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;
    }
}

Now activate the newly configured akaunting.conf file by adding file to sites-enabled directory.

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

For CentOS

In case of CentOS, please run the command below.

# sudo yum -y install nano 
# sudo nano /etc/nginx/conf.d/akaunting.conf

Now add the following text to opened file.

server {

  listen 80;
  listen [::]:80;

  server_name softpedia.xyz;

  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 127.0.0.1:9000;
  }

}

For CentOS and Ubuntu

To test Nginx configuration, execute the following command.

# sudo nginx -t

5

Now reload nginx server by executing the command below.

# sudo systemctl reload nginx.service

Install Akaunting

Create a folder for placing files of Akaunting and then assign necessary permissions.

Create root folder for Akaunting in /var/www directory.

# sudo mkdir -p /var/www/akaunting

Now change the ownership of /var/www/akaunting directory to aareez. In my case, username is aareez. You can replace it with your username.

# sudo chown -R aareez:aareez /var/www/akaunting

Navigate to /var/www/akaunting directory by executing command below.

# cd /var/www/akaunting

The following command will fetch the copy of Akaunting.

# curl -O -J -L https://akaunting.com/download.php?version=latest

Execute the command below to extract files from compressed zip folder.

# unzip Akaunting_1.2.12-Stable.zip

Now remove the downloaded zip folder by executing command below.

# rm Akaunting_1.2.12-Stable.zip

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

For Ubuntu

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

For CentOS

# sudo chown -R nginx:nginx /var/www/akaunting

Open the file by executing command below, to configure and find the user and group name in opened file. The current user and group are apache. Change apache to nginx and save the file.

# sudo nano /etc/php-fpm.d/www.conf

6

Now restart php-fpm by the command below.

# sudo systemctl restart php-fpm.service

Reload the Nginx server by executing the command below.

# sudo systemctl reload nginx.service

Now you can access Akaunting installer via your Alibaba Cloud ECS IP address. If you have pointed a domain to your IP address, you can also use it. In my case, I have pointed domain to my ECS IP address: http://softpedia.xyz/. After accessing, the following screen appears.

7

Hit the Next button, the following screen will appear. You will be asked to add details for your database. I have added details according the above procedure. Now hit Next.

8

Add the required details as shown below. Setup admin details, this will be used later to log in to the admin panel.

9

Hit Next and you will be redirected to login page as shown below.

10

After login, you will be redirected to the Akaunting dashboard.

11

Akaunting is now ready to use.

1 0 0
Share on

Alibaba Clouder

2,605 posts | 747 followers

You may also like

Comments

5892547131028633 January 10, 2019 at 2:41 pm

Hi, I just followe the tutorial and found that in my web browser just show the nginx welcome page.Thanks in advance.N.O

Arslan ud Din Shafiq January 17, 2019 at 11:15 am

My pleasure! Keep visiting and giving your feedback.