How to Install Mayan EDMS on Debian Latest

Mayan EDMS is an open-source document management system that allows users to store, manage, and search for documents in a secure and efficient manner. In this tutorial, we will guide you on how to install Mayan EDMS on Debian Latest.

Prerequisites

Step 1: Update the System

Before proceeding with the installation process, it is recommended to update the system packages to their latest versions. Open the terminal and run the following command:

sudo apt update && sudo apt upgrade

This command will update the package lists and upgrade any out-of-date packages on your system.

Step 2: Install Required Dependencies

The next step is to install the dependencies required for the Mayan EDMS installation. Use the following command to install the required packages:

sudo apt-get install build-essential libpq-dev libssl-dev libffi-dev python3-dev libjpeg-dev libopenjp2-7 libtiff-dev zlib1g-dev libpng-dev libxml2-dev libxslt-dev libyaml-dev poppler-utils redis-server supervisor

Step 3: Install PostgreSQL

To use Mayan EDMS, we need a database server. In this tutorial, we will be using PostgreSQL. To install PostgreSQL, run the following command:

sudo apt-get install postgresql

After the installation is complete, connect to the PostgreSQL server and create a new database and user for Mayan EDMS. Use the following commands to achieve this:

sudo -u postgres psql
CREATE DATABASE mayan;
CREATE USER mayan WITH PASSWORD ‘Password’;
GRANT ALL PRIVILEGES ON DATABASE mayan TO mayan;

Replace ‘Password’ with your desired database password.

Step 4: Install Mayan EDMS

Now we can proceed with the Mayan EDMS installation. Start by creating a new virtual environment and activating it. Use the following commands to do so:

sudo apt-get install python3-venv
mkdir ~/mayan-edms && cd ~/mayan-edms
python3 -m venv .venv
source .venv/bin/activate

Once the virtual environment is activated, install Mayan EDMS by running the following command:

pip install mayan-edms

Step 5: Setup Mayan EDMS

Now that Mayan EDMS is installed, we need to set it up. Start by running the following command to initialize the Mayan EDMS installation:

mayan-edms.py initialsetup

This command will take you through the Mayan EDMS setup wizard. Here, you will provide information about your database connection and create an admin account.

Following this, you will need to define the file storage backend. Mayan EDMS supports various storage backends such as Amazon S3, Dropbox, Google Cloud Storage, and more. In this tutorial, we will be using the filesystem storage backend. To configure the filesystem storage backend, run the following command:

mayan-edms.py platformtemplate --template=filesystem

This command will create a default storage directory, and you can edit the storage.yaml file located at ~/.mayan/settings to adjust the settings for the filesystem storage backend.

Step 6: Configure NGINX

To access Mayan EDMS web interface, we need to configure a web server. In this tutorial, we will be using NGINX. Install NGINX by running the following command:

sudo apt-get install nginx

Once installed, create a new server block configuration file for Mayan EDMS:

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

Paste the following configuration block into the file:

server {
    listen 80;
    server_name mayan.example.com;

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        client_max_body_size 100m;
    }
}

Replace mayan.example.com with the domain name or IP address you want to use to access Mayan EDMS.

Save and exit the file. Then, create a symbolic link to enable the newly created server block:

sudo ln -s /etc/nginx/sites-available/mayan /etc/nginx/sites-enabled/

Finally, restart NGINX to apply the changes by running the following command:

sudo systemctl restart nginx

Step 7: Start Mayan EDMS

Now, everything should be set up. Run the following command to start Mayan EDMS:

mayan-edms.py runserver

This command will start the development server, but it is not suitable for a production environment. For a production environment, use Supervisor to manage Mayan EDMS processes. To do this, create a new configuration file using the following command:

sudo nano /etc/supervisor/conf.d/mayan-edms.conf

Paste the following configuration block into the file:

[program:mayan]
command=/home/user/mayan-edms/.venv/bin/gunicorn --workers 4 --threads 2 --worker-class gthread --timeout 60 --limit-request-line 0 --limit-request-field_size 0 --log-level info mayan.wsgi:application
directory=/home/user/mayan-edms/
user=mayan
autorestart=true

Save and exit the file. Then, start and enable Supervisor by running the following commands:

sudo systemctl start supervisor
sudo systemctl enable supervisor

Mayan EDMS should now be accessible via your server’s IP address or domain name.

Conclusion

In this tutorial, we have guided you on how to install Mayan EDMS on Debian Latest. With Mayan EDMS, you can easily manage your documents and access them securely from anywhere. If you face any issues during the installation process, feel free to comment below, and we’ll be happy to help you.

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!