You can check whether you have the proper Debian version installed on your server with the following command:<\/p>\n
# lsb_release -a<\/pre>\nYou should get this output:<\/p>\n
Distributor ID: Debian\r\nDescription: Debian GNU\/Linux 9.9 (Stretch)\r\nRelease: 9.9\r\nCodename: stretch<\/pre>\nThen, run the following command to make sure that all installed packages on the server are updated to their latest available versions:<\/p>\n
# apt update && apt upgrade<\/pre>\nThis helps ensure that no mismatched versions or errors can occur. With that out of the way, we can start installing the packages that we\u2019ll need.<\/p>\n
<\/span>Step 2: Install NodeJS<\/span><\/h2>\nWe need to install the latest stable version of Node.js and the npm package manager onto our server. To do that, we have to install the NodeSource Node.js repository first, as it is not a pre-installed software repository.<\/p>\n
# apt install curl git build-essential software-properties-common\r\n# curl -sL https:\/\/deb.nodesource.com\/setup_10.x | bash -\r\n# apt install nodejs<\/pre>\nTo check the Node.js version you have just installed after these initial steps, type:<\/p>\n
# node -v<\/pre>\nYou should see an output similar to this.<\/p>\n
v10.16.1<\/pre>\n<\/span>Step 3: Install MongoDB Server<\/span><\/h2>\nDebian 9 official software package repositories come with version 3.2.11 of MongoDB, but in this article, we will install MongoDB 4.0 which is the latest available version. However, you can always check if a new version of MongoDB is available on their official website.<\/p>\n
In order to install the MongoDB 4.0 Community Edition on Debian 9, we need to import the public key used by the package management system. We can do that with the command:<\/p>\n
# apt-key adv --keyserver hkp:\/\/keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4<\/pre>\nOutput:<\/p>\n
Executing: \/tmp\/apt-key-gpghome.S7K61IhHP0\/gpg.1.sh --keyserver hkp:\/\/keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4\r\ngpg: key 68818C72E52529D4: public key \"MongoDB 4.0 Release Signing Key <packaging@mongodb.com>\" imported\r\ngpg: Total number processed: 1\r\ngpg: imported: 1\r\n<\/pre>\nNow, let’s create the \u2018\/etc\/apt\/sources.list.d\/mongodb-org-4.0.list\u2019 file using the following command:<\/p>\n
# apt update<\/pre>\nThe repository has been enabled and packages list is updated so we can continue with installing the MongoDB package with the following command:<\/p>\n
# apt install mongodb-org -y<\/pre>\nMongoDB server has been installed, we can check the version with this command.<\/p>\n
# mongod -version<\/pre>\nYou should have an output similar to this:<\/p>\n
MongoDB shell version v4.0.11\r\ngit version: 417d1a712e9f040d54beca8e4943edce218e9a8c\r\nOpenSSL version: OpenSSL 1.1.0k 28 May 2019\r\nallocator: tcmalloc\r\nmodules: none\r\nbuild environment:\r\n distmod: debian92\r\n distarch: x86_64\r\n target_arch: x86_64<\/pre>\nThat covers all of the dependencies, leaving us with the installation of Cezerin.<\/p>\n
<\/span>Step 4: Install Cezerin<\/span><\/h2>\nIn this step, we will download and install Cezerin from their GitHub repository.<\/p>\n
We are going to put installation under the \/opt\/ directory – let’s go to the directory and download Cezerin:<\/p>\n
# cd \/opt\r\n# git clone https:\/\/github.com\/cezerin\/cezerin.git cezerin<\/pre>\nNow that Cezerin has been downloaded to \/opt\/cezerin, now let’s go to the directory and proceed with the installation:<\/p>\n
# cd cezerin\r\n# npm install\r\n# npm run build<\/pre>\nNext, run this command to add the default data and create the indices:<\/p>\n
# npm run setup<\/pre>\nFinally, we can start the project:<\/p>\n
# npm start<\/pre>\nYou should see an output similar to this.<\/p>\n
> cezerin@0.33.0 start \/opt\/cezerin\r\n> concurrently npm:start-*\r\n\r\n[start-store]\r\n[start-store] > cezerin@0.33.0 start-store \/opt\/cezerin\r\n[start-store] > node -r esm dist\/store\/server\/index.js\r\n[start-store]\r\n[start-api]\r\n[start-api] > cezerin@0.33.0 start-api \/opt\/cezerin\r\n[start-api] > node -r esm src\/api\/server\/index.js\r\n[start-api]\r\n[start-store] info: Store running at http:\/\/localhost:3000\r\n[start-api] info: API running at http:\/\/localhost:3001\r\n[start-api] info: MongoDB connected successfully\r\n<\/pre>\nYou can use Ctrl + C to stop the service, now let’s proceed to the next step.<\/p>\n