Simple Node JS Server on Ubuntu MEAN one click image

Posted March 17, 2015 3.7k views
Node.jsDigitalOcean 1-Click Apps Marketplace

Hello there

I tried to setup a simple express server using the advice on here:

I followed the steps, and now have my main app.js file in the folder /opt/healthPill. I installed the node modules from here successfully.

I have tried to access the server through with no luck. I also tried, and in both cases I get net::ERRCONNECTIONREFUSED returned in my browser (Chrome) console log.

It is worth noting that I could not run the final command in the tutorial, as I did not have grunt installed, nor a gruntfile.js. As a result, I have tried with and without running the truncated command “NODE_ENV=production PORT=80”.

I am sorry if this is a really basic question, I am quite new to server config. All I am trying to do is create a small node server with one express POST endpoint. Running the project locally allows this.

Any help would be much appreciated.


1 comment
  • I’m not familiar with the MEAN stack but have a couple of ideas, or really questions:

    • is the process running? (the ‘ps’ command) and look for errors when you start the process
    • what port is it running on? ('sudo netstat -tulpn’) (look for local address
    • can you access it locally? 'wget
    • is the process bound to the external network ( should say for netstat)
    • is the port enabled ('sudo ufw status’)

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

The instructions in the linked tutorial are for running an app based on the MEAN.js stack, but you are by no way limited to using that tool set. The MEAN One-Click image simply gives you Node.js and MongoDB pre-installed with a sample project in /opt/mean

Grunt itself is installed and available system-wide, but of course unless you have a gruntfile.js in your project it isn’t very useful. In that case, just start the app as you normally would with npm start or calling node app.js directly.