Ubuntu

How to Install sysPass Password Manager on Ubuntu

How to Install sysPass Password Manager on Ubuntu
Written by itsubuntu

How to Install sysPass Password Manager on Ubuntu

sysPass is a free, open-source password manager. sysPass is built on top of HTML5 and PHP which supports AES-256-CTR for stronger password encryption. In this article, we will show you the steps to install sysPass password manager on Ubuntu.

How to Install sysPass Password Manager on Ubuntu

At first, we need to install the web server because sysPass is a PHP-based web application and it needs a web server along with a database to run on Ubuntu.

Install Apache HTTP server on Ubuntu

Run the following commands to install the Apache server on Ubuntu.

sudo apt update
sudo apt install apache2

The following commands are for the basic operation of Apache. They are used to stop, start and enable Apache to automatically start up when your Ubuntu starts up.

sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl enable apache2

You can run the following in your web browser to make sure that Apache is running.

http://localhost

Now, we need to install a Database too and we will be using MariaDB in this article.

Install MariaDB database server

Run the commands below to install MariaDB server on Ubuntu.

sudo apt update
sudo apt install mariadb-server

The following commands are for the basic operation of MariaDB. They are used to stop, start and enable MariaDB to automatically start up when your Ubuntu starts up.

sudo systemctl stop mariadb
sudo systemctl start mariadb
sudo systemctl enable mariadb

MariaDB security configuration:

Run the following command to create root login details for MariaDB.

sudo mysql_secure_installation

Now, we need to install PHP on Ubuntu.

Run the following command to add the PPA repository.

sudo add-apt-repository ppa:ondrej/php

Finally, run the commands below on your Ubuntu to install PHP version 7.4.

sudo apt install libapache2-mod-php7.4 php7.4 php7.4-mysqli php7.4-pdo php7.4 php7.4-cgi php7.4-cli php7.4-common php7.4-gd php7.4-json php7.4-readline php7.4-curl php7.4-intl php7.4-ldap php7.4-xml php7.4-mbstring git

Now create a database for sysPass .

sudo mysql -u root -p

Type the root password.

Then run the commands below to create a database named syspass_db.

CREATE DATABASE syspass_db;

Now create a database user account named syspassdb_user and set a password for it.

CREATE USER 'syspassdb_user'@'localhost' IDENTIFIED BY 'new_password_here';

Then grant the user full access to the database.

GRANT ALL ON syspass_db.* TO 'syspassdb_user'@'localhost' WITH GRANT OPTION;

Exit with the following command.

FLUSH PRIVILEGES;
exit;

Install sysPass

Run the commands below to download sysPass files.

git clone https://github.com/nuxsmin/sysPass.git

Next, move the downloaded files to the Apache root directory, and change the permissions and ownership.

sudo mv sysPass /var/www/html/syspass
sudo chown -R www-data:www-data /var/www/html/syspass
sudo chmod 750 /var/www/html/syspass/app/{config,backup}

Next, run the following command to create a composer script.

sudo nano /var/www/html/syspass/install-composer.sh

Now you need to copy the content below and paste it into the file, then save and exit.

#!/bin/sh
 EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)"
 php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
 ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
 if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
 then
     >&2 echo 'ERROR: Invalid installer signature'
     rm composer-setup.php
     exit 1
 fi
 php composer-setup.php --quiet
 RESULT=$?
 rm composer-setup.php
 exit $RESULT

Now, Run the following command to run the composer script created above, and install required PHP dependencies.

cd /var/www/html/syspass/
sudo sh install-composer.sh
sudo php composer.phar install --no-dev

Configure Apache for sysPass

Run the following commands to create an Apache server block file for sysPass.

sudo nano /etc/apache2/sites-available/syspass.conf

Copy and paste the following code into the file and save.

<VirtualHost *:80>
  ServerName syspass.example.com
  ServerAlias www.syspass.example.com
  ServerAdmin admin@example.com
  DocumentRoot /var/www/html/syspass
    
  <Directory /var/www/html/syspass/>
       Options FollowSymlinks
       AllowOverride All
       Require all granted
  </Directory>

       ErrorLog ${APACHE_LOG_DIR}/error.log
       CustomLog ${APACHE_LOG_DIR}/access.log combined
    
</VirtualHost>

Now, you need to enable the configuration above and restart Apache.

sudo a2ensite syspass
sudo systemctl restart apache2

Finally, it’s time to open your internet browser and run the following url. You will be able to see the syspass installation dashboard.

http://syspass.example.com

About the author

itsubuntu

Leave a Comment