Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying new node.js keystoneJS app on Digital Ocean

I am close to deploying my first node app (KeystoneJS) + mongoDb and I was thinking of using Digital Ocean. This would be the first node app I have deployed and first time using Digital Ocean. I've tried to find tutorials or guides from other people deploying an app built on keystone but have failed to uncover one. I would greatly appreciate it someone could share the steps they used to deploy a node app + keystone + mongo they built.

Thank you.

like image 622
Kevin Dark Avatar asked May 14 '26 22:05

Kevin Dark


1 Answers

It's quite simple yet nobody explains in detail. I had to bang my head for a while and I got it all figured out. I'm not a Linux specialist.

First, you set up a droplet with MEAN configuration. That takes care of the MongoDB and the Node setup.

Then you'll have to make Mongo to run as process:

Mongo Step 1: Remove lock file.
sudo rm /var/lib/mongodb/mongod.lock

Step 2: Repair mongodb.
mongod --repair

Step 3:
sudo mongod --port 27017 --fork --logpath /var/log/mongodb.log

Step 4: Check status of mongodb.
mongo

After that, once you moved your keystone project into your opt/mean folder, running node keystone in your terminal should do it.

You'll see something like:

KeystoneJS Started:<br/>
[your project name] is ready on port 3000

I highly recommend you start by running your project on your local machine first and move it after you're able to run it on localhost:3000.

like image 62
Dragos Avatar answered May 17 '26 13:05

Dragos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!