Here, I am choosing MongoDB which is a widely used NoSQL Database.
What you’ll need:
1. A VPS running Ubuntu 18.04
2. Secure shell (ssh) access to your VPS. You can connect using PuTTY on Windows or Terminal on Mac.
3. A basic understanding of ssh and Linux commands.
Let’s start:
1. Connect to Your Server:
Connect to your VPS via ssh as the root user.
`ssh root@yourservername`
Replace ‘yourservername’ with your server’s public IP address.
1. Update Your Server:
Always it’s good to start with an up-to-date system. Run the following commands to update your server.
```
sudo apt update
sudo apt upgrade
```
1. Import the MongoDB Public Key:
MongoDB is already included in the Ubuntu package repositories, but the official MongoDB repository provides most up-to-date version and is the recommended way of installing the software. Begin by importing the MongoDB GPG key:
```
wget -qO – https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
```
1. Add the MongoDB repository:
If you are running Ubuntu 18.04, issue the following command to add the MongoDB repository:
```
echo “deb bionic/mongodb-org/4.4 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
```
1. Install MongoDB:
Now you can install the MongoDB package itself by typing:
```
sudo apt update
sudo apt install mongodb-org
```
1. Start MongoDB:
Issue the following command to start the MongoDB daemon:
```
sudo systemctl start mongod
```
If you want to make sure that MongoDB automatically starts when your server starts up, you can type:
```
sudo systemctl enable mongod
```
1. Verify the Installation:
You can verify that the MongoDB server is running with the following command
```
sudo systemctl status mongod
```
If MongoDB is running correctly, you’ll see an output like this:
```
mongod.service – High-performance, schema-free document-oriented database
Loaded: loaded (/etc/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-04-26 14:08:26 UTC; 24h ago
Main PID: 4093 (mongod)
```
Also you can connect and interact with MongoDB using the MongoDB shell, which is an interactive JavaScript interface to MongoDB. You can start the MongoDB shell by typing:
```
mongo
```
This completes the installation and configuration of MongoDB database server on your VPS.
Note: Remember to replace placeholders (like ‘yourservername’) with actual data. Also, ensure that your database server is secured and cannot be accessed by everyone.
This guide is simplified and does not cover setting up replica sets/sharding for MongoDB. It also does not go into detail about securing your server.