How to Install EveryDocs on Elementary OS

In this tutorial, we will learn how to install EveryDocs, which is a document management system developed in Python. We will install it on Elementary OS Latest, which is a lightweight, fast and open-source Linux distribution. We will use the GitHub repository to download and install EveryDocs.

Prerequisites

Before we begin, you need to ensure that you have the following:

Installation Procedure

Follow these steps to install EveryDocs on your Elementary OS:

  1. Open the Terminal.

  2. Install the needed system packages by executing the following command:

    sudo apt-get install python3 python3-pip nginx python3-venv python3-dev libpq-dev libxml2-dev libxslt1-dev libjpeg-dev libfreetype6-dev
    
  3. Create and activate a Python virtual environment. You can do this by executing the following commands:

    python3 -m venv ~/.everydocs
    source ~/.everydocs/bin/activate
    
  4. Download EveryDocs from the GitHub repository by executing the following command:

    git clone https://github.com/jonashellmann/everydocs-core.git
    
  5. Change to the cloned repository directory by executing the following command:

    cd everydocs-core
    
  6. Install the Python dependencies by executing the following command:

    pip install -r requirements.txt
    
  7. Create the PostgreSQL database by executing the following commands:

    sudo su postgres
    createdb everydocsdb
    createuser everydocsuser
    psql
    GRANT ALL PRIVILEGES ON DATABASE everydocsdb TO everydocsuser;
    ALTER USER everydocsuser WITH PASSWORD 'yourpassword';
    \q
    exit
    

    Note: Remember to replace 'yourpassword' with your desired password.

  8. Create a configuration file by executing the following command:

    cp everydocs/settings/local.py.example everydocs/settings/local.py
    
  9. Edit the configuration file by executing the following command:

    nano everydocs/settings/local.py
    

    Update the following parameters in the configuration file:

    SECRET_KEY = 'generateyoursecretkey'
    DATABASES = {
       'default': {
          'ENGINE': 'django.db.backends.postgresql',
          'NAME': 'everydocsdb',
          'USER': 'everydocsuser',
          'PASSWORD': 'yourpassword',
          'HOST': 'localhost',
          'PORT': '',
       }
    }
    ALLOWED_HOSTS = ['localhost', '127.0.0.1', '[::1]']
    

    Note: Remember to replace 'generateyoursecretkey' with a random string of characters.

  10. Run the database migrations by executing the following command:

    python manage.py migrate
    
  11. Create a superuser by executing the following command:

    python manage.py createsuperuser
    
  12. Collect the static files by executing the following command:

    python manage.py collectstatic
    
  13. Test the installation by executing the following command:

    python manage.py runserver
    

    Open a web browser and access http://localhost:8000/. You should see the EveryDocs login page.

  14. Use Ctrl+C to stop the development server, and deactivate the Python virtual environment, by executing the following commands:

    deactivate
    
  15. Install Gunicorn and create a systemd service

    Install Gunicorn by executing the following command:

    pip install gunicorn
    

    Create a systemd service unit by executing the following command:

    sudo nano /etc/systemd/system/everydocs.service
    

    Add the following content to the file:

    [Unit]
    Description=EveryDocs Systemd Service
    After=network.target
    
    [Service]
    User=yourusername
    WorkingDirectory=/home/yourusername/everydocs-core/
    Environment="PATH=/home/yourusername/.everydocs/bin"
    ExecStart=/home/yourusername/.everydocs/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/yourusername/everydocs-core/everydocs.sock everydocs.wsgi:application
    
    [Install]
    WantedBy=multi-user.target
    

    Note: Change yourusername to your actual username.

  16. Reload the systemd daemon by executing the following command:

    sudo systemctl daemon-reload
    
  17. Start and enable the EveryDocs service by executing the following commands:

    sudo systemctl start everydocs
    sudo systemctl enable everydocs
    
  18. Configure nginx

    Create a new server block by executing the following command:

    sudo nano /etc/nginx/sites-available/everydocs
    

    Add the following content to the file:

    server {
        listen 80;
        server_name yourdomain.com;
    
        location = /favicon.ico { access_log off; log_not_found off; }
        location /static/ {
            root /home/yourusername/everydocs-core;
        }
    
        location / {
            include proxy_params;
            proxy_pass http://unix:/home/yourusername/everydocs-core/everydocs.sock;
        }
    }
    

    Note: Change yourdomain.com and yourusername to the actual values.

  19. Create a symbolic link by executing the following command:

    sudo ln -s /etc/nginx/sites-available/everydocs /etc/nginx/sites-enabled/
    
  20. Test the nginx configuration:

    sudo nginx -t
    
  21. Restart the nginx service by executing the following command:

    sudo systemctl restart nginx
    
  22. Open a web browser and access your domain. You should see the EveryDocs login page.

Congratulations! You have successfully installed EveryDocs on Elementary OS. You can now start using EveryDocs to manage your documents.

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!