How to Install PassIt on Ubuntu Server

Introduction

PassIt is a powerful and user-friendly password manager that can safely store your login details on your own server. It is built on top of Django and uses GPG to encrypt the passwords, ensuring maximum security. In this tutorial, you will learn how to install PassIt on Ubuntu Server.

Prerequisites

To follow this tutorial, you will need:

Step 1: Install Dependencies

Before installing PassIt, you need to install some dependencies. Open the terminal and type the following command:

sudo apt-get install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx curl gnupg2

Step 2: Set up PostgreSQL

PassIt requires a PostgreSQL database to store the encrypted passwords. To set up PostgreSQL, follow these steps:

  1. Log in to PostgreSQL as the default PostgreSQL user:

    sudo -u postgres psql
    
  2. Create a new database and a user with access to the new database:

    CREATE DATABASE passit_db;
    CREATE USER passit_user WITH PASSWORD 'password';
    GRANT ALL PRIVILEGES ON DATABASE passit_db TO passit_user;
    

    Note: Replace 'password' with a strong password of your choice.

  3. Exit PostgreSQL:

    \q
    

Step 3: Install PassIt

To install PassIt, follow these steps:

  1. Install PassIt using pip:

    sudo pip3 install passit
    
  2. Create a new PassIt project:

    sudo passit create_project my_project
    
  3. Edit the PassIt project settings file:

    sudo nano /opt/passit/my_project/settings.py
    

    Modify the following settings:

    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql',
            'NAME': 'passit_db',
            'USER': 'passit_user',
            'PASSWORD': 'password',
            'HOST': 'localhost',
            'PORT': '',
        }
    }
    
    ALLOWED_HOSTS = ['your.server.com']
    

    Note: Replace 'password' and 'your.server.com' with the values you used in Step 2.

  4. Apply the database changes:

    sudo passit --project my_project migrate
    
  5. Collect the static files:

    sudo passit --project my_project collectstatic
    

Step 4: Configure Nginx

To configure Nginx, follow these steps:

  1. Create a new Nginx server block:

    sudo nano /etc/nginx/sites-available/mysite.com
    
  2. Paste the following configuration:

    server {
        listen 80;
        server_name your.server.com;
        root /opt/passit/static/;
        index index.html;
    
        location / {
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_pass http://127.0.0.1:8000;
            proxy_read_timeout 600s;
            proxy_send_timeout 600s;
            client_max_body_size 0;
        }
    }
    

    Note: Replace 'your.server.com' with your own domain name.

  3. Enable the server block:

    sudo ln -s /etc/nginx/sites-available/mysite.com /etc/nginx/sites-enabled/
    
  4. Restart Nginx:

    sudo service nginx restart
    

Step 5: Start the PassIt Server

To start the PassIt server, type the following command:

sudo passit --project my_project runserver 0.0.0.0:8000

Conclusion

Congratulations! You have successfully installed PassIt on your Ubuntu Server. You can access it by navigating to your domain name in your web browser. If you encounter any issues, check the PassIt logs in /var/log/passit.

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!