{"id":40843,"date":"2022-05-23T12:30:06","date_gmt":"2022-05-23T17:30:06","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=40843"},"modified":"2022-12-05T05:13:37","modified_gmt":"2022-12-05T11:13:37","slug":"how-to-install-akaunting-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-install-akaunting-on-ubuntu-20-04\/","title":{"rendered":"How to Install Akaunting on Ubuntu 20.04"},"content":{"rendered":"
<\/p>\n
Akaunting is web-based, free, and open-source accounting software designed to help small businesses. It helps small businesses<\/a> and freelancers manage and streamline payment, invoicing, and other operations. With its client portal features, administrators are able to share financial information like transactional and invoicing information with the clients. The application also offers complete tools to manage your finances. These are their main features:<\/p>\n <\/p>\n – App Store Installing Akaunting is a fairly easy task. In this tutorial, we will show you how to install Akaunting on Ubuntu 20.04.<\/p>\n First, log in to your Ubuntu 20.04 server<\/a> through SSH as the root user:<\/p>\n You will need to replace ‘IP_Address’ and ‘Port_number’ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the system user with sudo privileges.<\/p>\n You can check whether you have the proper Ubuntu version installed on your server with the following command:<\/p>\n You should get this output:<\/p>\n Before starting, you have to make sure that all Ubuntu OS packages installed on the server are up to date. You can do this by running the following commands:<\/p>\n We need to install web server, database server and PHP to proceed with installing akaunting. In this post, we will use Nginx instead of Apache. So, let’s run the command below to install LEMP.<\/p>\n On Ubuntu 20.04, Nginx and MariaDB are configured to start running upon installation, you can check them by running this command:<\/p>\n Akaunting supports MySQL, PostgreSQL, and SQLite. We installed MySQL\/MariaDB in the previous step, so we will be using it for the installation. Or, if you already give MySQL root user a password, then you need to run this command to enter the MySQL shell:<\/p>\n Once logged in, let’s run the following commands to create a new database for akaunting installation.<\/p>\n Make sure you create a stronger database password, replace m0d1fyth15 in the command above with a stronger one.<\/p>\n At the time of writing, we downloaded Akaunting version 2.1.33. You can download the latest version of Akaunting from their website or directly from their GitHub repository.<\/p>\n Then, change the ownership of the files and akaunting directory.<\/p>\n Let’s create a new Nginx server block.<\/p>\n Paste the following content into the file, make sure you edit the server_name and use your actual domain or subdomain name.<\/p>\n Save the file then exit from Nano editor.<\/p>\n After creating a server block, we need to restart nginx. Do not forget to test the configuration file prior to restarting nginx.<\/p>\n Open your favorite web browser and navigate to your In the initial step, you will be asked to choose your language. Choose your desired language then click Next.<\/p>\n <\/p>\n In this step, you need to insert the database details you created earlier. Click Next to continue.<\/p>\n <\/p>\n You need to create an admin user in this step. The combination of admin email address and the admin password is required to log in to Akaunting backend, click next to continue.<\/p>\n <\/p>\n You will be brought to the Akaunting login screen, enter the administrative user you created earlier then click on the Login button.<\/p>\n <\/p>\n Once logged in, you will need to provide your company information and finish all 4 steps as seen in the picture below.<\/p>\n <\/p>\n After finishing the steps above, you can click on the ‘Go to dashboard’ button to enter the website backend.<\/p>\n <\/p>\n That’s all. You can now start working and using Akaunting to manage your financial things.<\/p>\n This is an optional step but highly recommended to complete. We will install a free SSL certificate from Let’s Encrypt.<\/p>\n Once completed, we can run this command to install the SSL certificate.<\/p>\n You will be asked for your email address, accept the Let’s Encrypt TOS, and whether you want to share your email address with the Electronic Frontier Foundation or not. Then, you need to choose which names would you like to activate HTTPS for. Choose your Akaunting website by typing the number and hitting ENTER. Let’s encrypt will install the certificate and it will ask you whether to configure HTTP to HTTPS redirect or not, you can choose redirect then certbot will create the redirection and reload nginx if everything is okay.<\/p>\n Now, you should be able to access your Akaunting<\/a> website in HTTPS mode at
\n– Bank Accounts
\n– Billable Expenses
\n– Client Portal
\n– Customer Management
\n– Easy Invoicing
\n– Fine-Grained Permissions
\n– Inventory Management
\n– Multi-Company
\n– Multi-Currency
\n– Multilingual Panel
\n– Permission Management
\n– Process Automation
\n– Powerful Reporting
\n– Tax Rates
\n– Transaction Categories
\n– Unlimited Attachments
\n– Vendor Management<\/p>\nPrerequisites<\/h2>\n
\n
Step 1. Log in to the server<\/h3>\n
ssh root@IP_Address -p Port_number<\/pre>\n
$ lsb_release -a<\/pre>\n
No LSB modules are available.\r\nDistributor ID: Ubuntu\r\nDescription: Ubuntu 20.04.3 LTS\r\nRelease: 20.04\r\nCodename: focal<\/pre>\n
$ sudo apt update -y\r\n$ sudo apt upgrade -y<\/pre>\n
Step 2. Install LEMP<\/h3>\n
$ sudo apt install wget unzip nginx-full mariadb-server mariadb-client php7.4-{bcmath,cli,curl,fpm,gd,gmp,json,mbstring,mysql,snmp,xml,zip}<\/pre>\n
$ sudo systemctl status mysql nginx --lines=0<\/pre>\n
Step 3. Create a Database<\/h3>\n
\nBy default, the MySQL root user does not have a password, you can run this command to log in to the MySQL shell.<\/p>\n$ sudo mysql<\/pre>\n
$ mysql -u root -p<\/pre>\n
MariaDB [(none)]> CREATE DATABASE akaunting;\r\nQuery OK, 1 row affected (0.000 sec)\r\n\r\nMariaDB [(none)]> CREATE USER 'akaunting'@'localhost' IDENTIFIED BY 'm0d1fyth15';\r\nQuery OK, 0 rows affected (0.000 sec)\r\n\r\nMariaDB [(none)]> GRANT ALL PRIVILEGES ON akaunting.* TO 'akaunting'@'localhost';\r\nQuery OK, 0 rows affected (0.001 sec)\r\n\r\nMariaDB [(none)]> FLUSH PRIVILEGES;\r\nQuery OK, 0 rows affected (0.000 sec)\r\n\r\nMariaDB [(none)]> \\q<\/pre>\n
Step 4. Download Akaunting<\/h3>\n
$ cd \/tmp\r\n$ wget https:\/\/akaunting.com\/download.php?version=latest -O akaunting.zip\r\n$ sudo unzip akaunting.zip -d \/var\/www\/html\/akaunting<\/pre>\n
$ sudo chown -R www-data. \/var\/www\/html\/akaunting<\/pre>\n
Step 5. Configure Nginx<\/h3>\n
$ sudo nano \/etc\/nginx\/sites-enabled\/akaunting.conf<\/pre>\n
server {\r\n listen 80;\r\n server_name akaunting.yourdomain.com;\r\n\r\n root \/var\/www\/html\/akaunting\/;\r\n index index.php index.html index.htm;\r\n charset utf-8;\r\n error_log \/var\/log\/nginx\/akaunting.error;\r\n access_log \/var\/log\/nginx\/akaunting.access;\r\n\r\n add_header X-Frame-Options \"SAMEORIGIN\";\r\n add_header X-XSS-Protection \"1; mode=block\";\r\n add_header X-Content-Type-Options \"nosniff\";\r\n\r\n location \/ {\r\n try_files $uri $uri\/ \/index.php?$query_string;\r\n }\r\n\r\n # Protect Files\r\n location ~ \\.(env|log) {\r\n deny all;\r\n }\r\n\r\n # Protect Directories\r\n location ~ ^\/(^app$|bootstrap|config|database|resources|routes|storage|tests|artisan) {\r\n deny all;\r\n }\r\n\r\n # Prevent Direct Access To modules\/vendor Folders Except Assets\r\n location ~ ^\/(modules|vendor)\\\/(.*)\\.((?!ico|gif|jpg|jpeg|png|js|css|less|sass|font|woff|woff2|eot|ttf|svg).)*$ {\r\n deny all;\r\n }\r\n\r\n error_page 404 \/index.php;\r\n\r\n location ~ \\.php$ {\r\n fastcgi_split_path_info ^(.+\\.php)(\/.+)$;\r\n fastcgi_pass unix:\/run\/php\/php7.4-fpm.sock;\r\n fastcgi_index index.php;\r\n include fastcgi_params;\r\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n }\r\n\r\n location ~ \/\\.(?!well-known).* {\r\n deny all;\r\n }\r\n\r\n}\r\n<\/pre>\n
$ sudo nginx -t\r\n$ sudo systemctl restart nginx<\/pre>\n
Step 6. Install Akaunting<\/h3>\n
http:\/\/yourdomain.com<\/code> you configured in the previous step.<\/p>\n
\n<\/p>\nStep 7. Install SSL certificate<\/h3>\n
$ sudo apt install python3-certbot-nginx -y<\/pre>\n
$ sudo certbot<\/pre>\n
https:\/\/akaunting.yourdomain.com<\/code>, you can proceed with building your application using Akaunting.<\/p>\n