How to Install Passbolt on Debian Latest?

In this tutorial, we will guide you through the process of installing Passbolt, a free and open-source password manager for teams, on Debian latest version.

Prerequisites

Before you begin, make sure you have the following prerequisites:

Step 1: Update your System

Once you have logged into your Debian system, it is best practice to update your system packages to the latest version using the apt package manager.

sudo apt update && sudo apt upgrade -y

Step 2: Install Required Dependencies

To install Passbolt, you need to install some necessary packages for the installation process with the below command.

sudo apt install -y \
gnupg gnupg2 gnupg1 \
nginx \
php7.4-cli \
php7.4-fpm php7.4-curl php7.4-gd php7.4-mysql php7.4-intl php7.4-imap \
php7.4-imagick php7.4-json php7.4-ldap php7.4-mbstring php7.4-xml php7.4-xmlrpc php7.4-zip \
mariadb-server mariadb-client \
wget \
sudo add-apt-repository -y ppa:certbot/certbot && sudo apt-get update
sudo apt-get install -y python-certbot-nginx

Step 3: Install Passbolt

Now it's time to download and install the Passbolt.

wget -O /tmp/passbolt.zip https://github.com/passbolt/passbolt_api/releases/download/$PASSBOLT_VERSION/passbolt-$PASSBOLT_VERSION.zip
sudo unzip /tmp/passbolt.zip -d /var/www/passbolt
sudo chown -R www-data:www-data /var/www/passbolt

Where $PASSBOLT_VERSION is the version you wish to install. You can find the latest version on the Passbolt official website.

Step 4: Prepare Passbolt Configuration

Next, create a database and user on the MySQL instance with the below command.

sudo mysql -u root -p

Once you have logged into the MySQL terminal, create a database and user for Passbolt with the below command.

CREATE DATABASE passboltdb;
CREATE USER 'passboltuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON passboltdb.* TO 'passboltuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Now, navigate to the Passbolt configuration directory with the below command.

sudo cd /var/www/passbolt/config

And copy the sample file to a new file with the below command.

sudo cp app.default.php app.php

Edit app.php file and set the following values:

sudo vim /var/www/passbolt/config/app.php
// database configuration
    'Datasources' => [
        'default' => [
            'host' => 'localhost',
            'port' => '3306',
            'username' => 'passboltuser',
            'password' => 'password',
            'database' => 'passboltdb',
            'driver' => 'Cake\Database\Driver\Mysql',
            'timezone' => 'UTC',
            'flags' => [],
            'cacheMetadata' => true,
            'log' => false,
            'quoteIdentifiers' => false,
            'url' => env('DATABASE_URL', null),
        ], 

// setup email configuration
    'EmailTransport' => [
        'default' => [
            'className' => 'Mail',
            'host' => 'localhost',
            'port' => 25,
            'timeout' => 30,
            'username' => '',
            'password' => '',
            'client' => null,
            'tls' => null,
            'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
        ],
    ],

// configuration for GPG key server
    'Gpg' => [
        'server' => [
            'homedir' => env('GNUPGHOME', '/var/www/.gnupg'),
            'keyserver' => 'keyserver.ubuntu.com',
            'options' => array(),
        ],
    ],

Step 5: Configure Nginx

Create a new nginx server block file for the Passbolt installation with the below command.

sudo vim /etc/nginx/sites-available/passbolt

Add the following configuration block in the file.

server {
    listen 80;
    listen [::]:80;
    root /var/www/passbolt/webroot;
    index index.php index.html;
    server_name your-domain-name.com;
    error_log /var/log/nginx/passbolt_error.log warn;
    access_log /var/log/nginx/passbolt_access.log;
    location / {
        try_files $uri $uri/ /index.php?$args;
    }
    location ~* \.php$ {
        try_files $uri /index.php =404;
        include fastcgi_params;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}

Now activate the server block file.

sudo ln -s /etc/nginx/sites-available/passbolt /etc/nginx/sites-enabled/
sudo systemctl reload nginx

Step 6: Access Passbolt

Now you can access the Passbolt from a browser with the URL http://your-domain-name.com. You will be redirected to the setup wizard. Follow the on-screen instructions to complete the setup.

Conclusion

In this tutorial, we have shown you how to install Passbolt on Debian latest version. You can now use Passbolt to manage your passwords securely.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!