How to Install NirvaShare on Ubuntu 20.04

Updated on June 8, 2022
How to Install NirvaShare on Ubuntu 20.04 header image

NirvaShare is a file-sharing solution that lets you create and share files for collaboration with other users, employees, or customers. It integrates with Vultr Object Storage for easy file usage and sharing. The following steps explain installing NirvaShare on a Ubuntu 20.04 server.

Prerequisites

Before you start, you should:

1. Setup Vultr Object Storage

NirvaShare works well with Vultr Object Storage. To create an Object Storage bucket for NirvaShare, follow the steps below.

  1. Log in to the Vultr customer portal
  2. Under Products, navigate to Objects
  3. Click Add storage
  4. Set the Object Storage label, and click Add to deploy.
  5. After installation is complete, click Edit.
  6. Copy the Secret and Access Keys listed under S3 Credentials.
  7. Navigate to Buckets and click Create Bucket.
  8. Assign the bucket a unique name, and click Create Bucket to deploy.

2. Install NirvaShare

  1. Create the NirvaShare data directory and switch to it.

     $ sudo mkdir /opt/nirvashare
     $ cd /opt/nirvashare
  2. Using a text editor, create a new docker-compose file.

     $ sudo nano nirvashare.yml
  3. Add the following configuration to the file.

     version: "3"
     services:
       admin:
         image: 'nirvato/nirvashare-admin:latest'
         container_name: 'nirvashare_admin'
         restart: always
         ports:
           - '8080:8080'
         environment:
           ns_db_jdbc_url: "jdbc:postgresql://nirvashare_database:5432/postgres"
           ns_db_username: "nirvashare"
           ns_db_password: "__DB_PASS__"
         volumes:
           - /var/nirvashare:/var/nirvashare
    
         depends_on:
           - db
    
       userapp:
         image: 'nirvato/nirvashare-userapp:latest'
         container_name: 'nirvashare_userapp'
         restart: always
         ports:
           - '8081:8080'
         environment:
           ns_db_jdbc_url: "jdbc:postgresql://nirvashare_database:5432/postgres"
           ns_db_username: "nirvashare"
           ns_db_password: "__DB_PASS__"
         volumes:
           - /opt/nirvashare:/var/nirvashare
         depends_on:
           - admin
    
       db:
        image: 'postgres:13.2'
        container_name: 'nirvashare_database'
        restart: always
        ports:
          - '5432:5432'
        environment:
          POSTGRES_PASSWORD: '__DB_PASS__'
          POSTGRES_USER: 'nirvashare'
        volumes:
           - db_data:/var/lib/postgresql/data
    
     volumes:
        db_data:

    Save the file.

  4. Install NirvaShare.

     $ sudo docker-compose -f nirvashare.yml up -d
  5. Start NirvaShare.

     $ docker start nirvashare_admin
     $ docker start nirvashare_userapp
  6. Verify that NirvaShare is up and running.

     $ docker ps

3. Configure Nginx as a Reverse Proxy

  1. Create a new Nginx configuration file.

     $ sudo nano /etc/nginx/conf.d/nirvashare.example.conf
  2. Add the following configuration lines to the file.

     server {
        listen 80;
        listen [::]:80;
    
        server_name nirvashare.example.com;
    
        location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    
        }
     }

    Save the file.

  3. Test the Nginx configuration for errors.

     $ sudo nginx -t
  4. Restart Nginx.

     $ sudo systemctl restart nginx

4. Security

By default, Uncomplicated firewall (UFW) is active on Ubuntu. Configure it to allow HTTP and HTTPS access on the server.

  1. Allow HTTP.

     $ sudo ufw allow http
  2. Allow HTTPS.

     $ sudo ufw allow https
  3. Reload the firewall rules.

     $ sudo ufw reload

5. Setup HTTPS Access

  1. Install Certbot for Nginx.

     $ sudo apt install certbot python3-certbot-nginx
  2. Request a free SSL certificate.

     $ sudo certbot --nginx -d nirvashare.example.com
  3. Restart Nginx to load changes.

     $ sudo systemctl restart nginx

6. Configure NirvaShare

  1. Using a web browser, visit your subdomain.

     https://nirvashare.example.com 
  2. Log in to Nirvashare with the following credentials:

    Username: admin Password: admin

  3. Navigate to Settings.

  4. Click Edit next to File Storage.

  5. Toggle the Type of Storage drop-down and select Vultr Object Storage from the list.

    Setup Vultr Object Storage on NirvaShare

  6. Enter the Vultr Object Storage keys created earlier, and click the green checkmark to save changes.

  7. Navigate to Storage to access, create new, and share files on your block storage.

  8. To secure your server, navigate to Users and Roles, and update the default administrator account with a new password. Navigate to Settings and change the default login profile for additional security.

Next Steps

You have successfully installed NirvaShare on a Ubuntu 20.04 server. For further configuration options, refer to the following articles.