Tutorials  /  Ubuntu

Install Strider CD on Ubuntu 18.04 with MongoDB and PM2

Ccentron Redaktion · May 2025 ·6 min read ·Ubuntu, Tutorial

Strider CD is a free and open-source platform for continuous deployment. Developed with Node.js, it leverages MongoDB as its primary data storage. Strider supports an extensive plugin system that enhances its core functionality.

Prerequisites

  • A brand new Ubuntu 18.04 instance with a minimum of 1 GB RAM
  • A non-root user configured with sudo permissions
  • All system packages should be updated to the latest version

Update and upgrade the system packages by running the following command:

Console
sudo apt-get update && sudo apt-get upgrade -y
VM

Matching infrastructure at centron

Ubuntu servers without your own hardware: ccloud³ VMs with full root access from €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

Step 1: Setting Up Node.js and NPM

Nodesource offers ready-to-use binaries for Node.js, which can be installed through the system's package manager. First, add the Nodesource repository:

Console
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -

Then proceed to install Node.js:

Console
sudo apt-get install -y nodejs

NPM is automatically included with the Node.js installation. To verify that both Node.js and NPM were installed properly, check their versions:

Code
strider@centron:~$ node -v
v10.15.3
strider@centron:~$ npm -v
6.4.1

Step 2: Installing Git and node-gyp

Although Git is usually pre-installed systems, you can verify and ensure it's properly installed and up to date using the following command:

Console
sudo apt-get install -y git

Next, install node-gyp, a tool for compiling native add-ons for Node.js:

Console
sudo npm install -g node-gyp

Step 3: Setting Up MongoDB

Begin by importing MongoDB’s public GPG key to ensure the authenticity of the downloaded packages:

Console
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4

Then add the MongoDB repository to your system’s package sources:

Console
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list

Update the package index and install MongoDB:

Console
sudo apt-get update
sudo apt-get install -y mongodb-org

Finally, start the MongoDB service and configure it to launch automatically at system startup:

Console
sudo systemctl start mongod
sudo systemctl enable mongod

Step 4: Configuring MongoDB Authentication

To begin configuring authentication for MongoDB, launch the MongoDB shell:

Code
strider@centron:~/strider$ mongo
MongoDB shell version v4.0.8
connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("a06b2797-6f58-43e1-8a41-c6401edb5083") }
MongoDB server version: 4.0.8
Welcome to the MongoDB shell.
...

Switch to the admin database with the following command:

Code
use admin

Create a new administrator account. You should change the username and password to your own secure credentials:

Code
db.createUser(
  {
    user: "admin",
    pwd: "StrongPassword",
    roles: [ { role: "userAdminAnyDatabase", db: "admin" }, "readWriteAnyDatabase" ]
  }
)

To exit the MongoDB shell, press Ctrl+C.

Next, open the MongoDB configuration file using a text editor:

Console
sudo nano /etc/mongod.conf

Locate the line that says #security: and replace it with the following configuration to enable authorization:

YAML
security:
  authorization: "enabled"

Save your changes and exit the editor. To apply the changes, restart the MongoDB service:

Console
sudo systemctl restart mongod

Step 5: Installing Strider

To begin installing Strider, start by cloning the project repository from GitHub:

Console
cd ~
git clone https://github.com/Strider-CD/strider.git

Move into the newly created directory and install all required Node.js dependencies:

Console
cd ~/strider
npm install

Reopen the Mongo shell to set up a dedicated database for Strider:

Code
mongo

Authenticate your session with the previously created administrator credentials:

Code
use admin
db.auth("admin", "StrongPassword" )

Create a new MongoDB user for Strider and assign it to the strider database. Be sure to replace the password striderpw with a secure one:

Code
use strider
db.createUser({user: "strider", pwd: "striderpw", roles: [{role: "dbOwner", db: "strider"}]})

Press Ctrl+C to exit the Mongo shell.

Now, add an administrator user to Strider by running this command. Replace the credentials and details as needed:

Code
DB_URI="mongodb://strider:striderpw@localhost:27017/strider" node bin/strider addUser

When prompted by the script, provide your email and a new password for the admin user:

Code
strider@centron:~/strider$ DB_URI="mongodb://strider:striderpw@localhost:27017/strider" node bin/strider addUser
Connecting to MongoDB URL: mongodb://strider:striderpw@localhost:27017/strider

Enter email []: centron@example.com
Enter password []: ****
Is admin? (y/n) [n]y

Email:        centron@example.com
Password:    ****
isAdmin:    y
OK? (y/n) [y]y
User created successfully! Enjoy.

Step 6: Managing the Strider Process with PM2

To handle your Node.js application efficiently, install PM2 globally using NPM:

Console
sudo npm install pm2 -g

Next, navigate to the Strider directory and create a PM2 configuration file:

Console
cd ~/strider && nano ecosystem.config.js

Insert the following configuration into the file. Be sure to replace the placeholder IP address 203.0.113.1 with the real IP address of your centron server:

Code
module.exports = {
  apps : [{
    name   : "strider",
    script : "npm",
    args : "start",
    env: {
      "NODE_ENV": "production",
      "DB_URI": "mongodb://strider:striderpw@localhost:27017/strider",
      "SERVER_NAME": "http://203.0.113.1:3000",
      "HOST": "0.0.0.0",
      "PORT": "3000"
    }
  }]
}

Now, launch the Strider application using the PM2 configuration:

Code
pm2 start ecosystem.config.js

To ensure that Strider automatically starts on system reboot, execute the following:

Code
pm2 startup

Finally, open your web browser and visit http://203.0.113.1:3000—replacing the IP with your server’s actual address. Log in using the administrator credentials you previously set up for Strider.

Conclusion

By following the steps in this guide, you have successfully set up Strider CD on a Ubuntu 18.04 server. The environment includes Node.js, MongoDB with authentication, and PM2 for process management, ensuring that your continuous deployment pipeline is reliable and persistent across reboots. You can now start deploying your projects with confidence using Strider’s powerful and extensible platform.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Ubuntu
Teilen
Noch offene Fragen?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

War dieses Tutorial hilfreich?

Your answer is stored anonymously and helps us improve our tutorials.

Kommentare

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren