Come hang with us on Discord and chat directly with the team!Discordtop-bar-close-icon

2024-08-28

How to Install Docmost: Your Ultimate Document Management Solution

tutorials
img

Are you looking for a powerful, open-source document management system? Look no further! In this comprehensive guide, we'll walk you through the process of installing Docmost on your CloudBlast VPS. Docmost offers a robust solution for organizing, sharing, and collaborating on your documents. Let's dive in and get your document management system up and running!

Prerequisites

Before we begin, ensure you have:

1. A CloudBlast VPS running a recent version of Ubuntu or Debian
2. Root access or a user with sudo privileges
3. Basic familiarity with command-line operations

Step 1: Update Your System

First, let's ensure your system is up-to-date:


sudo apt update && sudo apt upgrade -y
 

Step 2: Install Required Dependencies

Docmost requires several dependencies. Let's install them:


sudo apt install curl software-properties-common apt-transport-https ca-certificates gnupg2 -y
 

Step 3: Install Node.js

Docmost is built on Node.js. Let's install Node.js 14.x:


curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt install nodejs -y
 

Verify the installation:


node --version
npm --version
 

Step 4: Install MongoDB

Docmost uses MongoDB as its database. Let's install it:


wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
sudo apt update
sudo apt install mongodb-org -y
 

Start and enable MongoDB:


sudo systemctl start mongod
sudo systemctl enable mongod
 

Step 5: Install Docmost

Now, let's install Docmost:


sudo npm install -g docmost
 

Step 6: Configure Docmost

Create a configuration directory:


sudo mkdir -p /etc/docmost
 

Create and edit the configuration file:


sudo nano /etc/docmost/config.json
 

Add the following content, adjusting as needed:


{
  "port": 3000,
  "mongodb": {
    "url": "mongodb://localhost:27017/docmost"
  },
  "storage": {
    "type": "local",
    "path": "/var/lib/docmost/uploads"
  },
  "secret": "your-secret-key-here"
}
 

Save and close the file (Ctrl+X, then Y, then Enter).

Step 7: Set Up Docmost as a Service

Create a systemd service file:


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

Add the following content:


[Unit]
Description=Docmost Document Management System
After=network.target

[Service]
ExecStart=/usr/bin/node /usr/lib/node_modules/docmost/server.js
Restart=always
User=nobody
Group=nogroup
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
WorkingDirectory=/usr/lib/node_modules/docmost

[Install]
WantedBy=multi-user.target
 

Save and close the file.

Step 8: Start and Enable Docmost

Now, let's start and enable the Docmost service:


sudo systemctl start docmost
sudo systemctl enable docmost
 

Step 9: Set Up Nginx as a Reverse Proxy (Optional)

If you want to access Docmost through a domain name and add SSL, you can set up Nginx as a reverse proxy.

Install Nginx:


sudo apt install nginx -y
 

Create a new Nginx configuration file:


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

Add the following content, replacing `yourdomain.com` with your actual domain:


server {
    listen 80;
    server_name yourdomain.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}
 

Enable the configuration:


sudo ln -s /etc/nginx/sites-available/docmost /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
 

Step 10: Secure Your Installation

For production use, consider the following security measures:

1. Set up a firewall (e.g., UFW)
2. Install and configure SSL/TLS certificates (e.g., using Let's Encrypt)
3. Regularly update your system and Docmost installation

Accessing Docmost

You can now access Docmost by navigating to `http://your_server_ip:3000` in your web browser (or `http://yourdomain.com` if you set up Nginx).

Conclusion

Congratulations! You've successfully installed Docmost on your CloudBlast VPS. You now have a powerful, self-hosted document management system at your fingertips. Explore Docmost's features to organize, share, and collaborate on your documents with ease.

Remember, this is just the beginning of your Docmost journey. Take time to familiarize yourself with its features and customize it to fit your specific needs. If you encounter any issues or need further assistance, don't hesitate to reach out to CloudBlast's expert support team.

Happy document managing!