Unable to install MongoDB 4.4 on Ubuntu 18.04 LTS

I am following this link to install MongoDB Community Edition 4.4 on Ubuntu 18.04 LTS but MongoDB service is not running

$ sudo service mongodb status
Unit mongodb.service could not be found.

Following commands are used during installation

# Install Prerequisites
$ sudo apt-get install libcurl4 openssl liblzma5

# Extract the files from the archive
# Binary located at path: /home/atinesh/Downloads/Current/MongoDB/mongodb-linux-x86_64-ubuntu1804-4.4.8.tgz
$ tar -zxvf mongodb-linux-x86_64-ubuntu1804-4.4.8.tgz

# Create the data and log directories
$ sudo mkdir -p /var/lib/mongo
$ sudo mkdir -p /var/log/mongodb

# Give read and write permission
$ sudo chown atinesh /var/lib/mongo
$ sudo chown atinesh /var/log/mongodb

# Add MongoDB installation path to ~/.bashrc
export PATH="/home/atinesh/Downloads/Current/MongoDB/mongodb-linux-x86_64-ubuntu1804-4.4.8/bin:$PATH"  

# Run MongoDB
$ mongod --dbpath /var/lib/mongo --logpath /var/log/mongodb/mongod.log --fork
about to fork child process, waiting until server is ready for connections.
forked process: 15320
child process started successfully, parent exiting

Complete log file mongod.log

You don’t get a systemd service target with the tgz intstall. You’ll have to create one, or copy one.

If you want a install and run installation use the package manager version.

2 Likes

Thanks I got it, installation was actually successful

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.