How to Install Akaunting on CentOS and Ubuntu

Prerequisites

# sudo apt update && sudo apt upgrade
# sudo yum update -y

Basic Setup

Install unzip

# sudo apt-get install unzip
# sudo yum install unzip -y

Install build-essential

# sudo apt install build-essential

Install EPEL repository

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

Install Webstatic Yum Repository

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

Install PHP

# sudo apt install -y php7.0
# sudo yum install -y php72w

Install PHP Extensions

# 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
# 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

# php -v

Install MySQL Server

# sudo apt install -y mysql-server
# sudo mysql_secure_installation
# sudo yum install -y mariadb-server
# sudo systemctl enable mariadb
# sudo systemctl start mariadb
# sudo mysql_secure_installation

Configure Database

# mysql -u root -p
CREATE DATABASE ak;
GRANT ALL ON ak.* TO 'ak' IDENTIFIED BY '654321Ab';
FLUSH PRIVILEGES;
EXIT;

Install Nginx Server

# sudo apt-get install nginx
# sudo yum -y install nginx
# sudo systemctl start nginx
# sudo systemctl status nginx
# sudo nginx -v

Configure Nginx Server

# sudo nano /etc/nginx/sites-available/akaunting.conf
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;
}
}
# sudo ln -s /etc/nginx/sites-available/akaunting.conf /etc/nginx/sites-enabled/
# sudo yum -y install nano 
# sudo nano /etc/nginx/conf.d/akaunting.conf
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;
}
}
# sudo nginx -t
# sudo systemctl reload nginx.service

Install Akaunting

# sudo mkdir -p /var/www/akaunting
# sudo chown -R aareez:aareez /var/www/akaunting
# cd /var/www/akaunting
# curl -O -J -L https://akaunting.com/download.php?version=latest
# unzip Akaunting_1.2.12-Stable.zip
# rm Akaunting_1.2.12-Stable.zip
# sudo chown -R www:www-data /var/www/akaunting
# sudo chown -R nginx:nginx /var/www/akaunting
# sudo nano /etc/php-fpm.d/www.conf
# sudo systemctl restart php-fpm.service
# sudo systemctl reload nginx.service

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store