Help with Production - Dreamhost as provider, using Passenger

Hello all. I’m relatively new to Adonis.js, but I have some background with Laravel and wanted to give a node project a whirl. Pardon my ignorance with this platform… I’m still very green.

Presently, I have some sites hosted at Dreamhost and thought this a good place to test things out. At my site I’ve SSH’ed in and installed / updated Node, NPM, and now am seeking some help getting things live.

I followed the “Quick Start” instructions and all seems to have installed just fine. However, Dreamhost uses Passenger to manage / launch / etc… Node. Passenger simply seeks out a file called “app.js” in the main project folder and calls it automatically (so no need for the “adonis serve --dev” command). While I am not fully versed in Adonis (nor Node, frankly), I don’t see a surrogate for the typical app.js file most DIY node servers are spun up with.

Can someone point me towards this direction or share any experience they have with DreamHost? If possible, I’d prefer to stay at this host due to other endeavors there rather than spin off some other direction for the sake of temporary simplicity.

Thank you.

As an update, I have made some progress. Presently still trying to get just boilerplate to run in a Dreamhost VPS environment.

It is possible to get an Adonis instance up and running. I have done this by disabling the “Passenger” modules from the DH control panel and using PM2 to serve it:

npm install pm2 -g
pm2 start server.js

However in order to access, I need to specify a port in the .env file (8080 for instance) and reference it that way specifically in the browser. Unsure at the present how to over-ride the default “[YOUR SITE] is almost here!” messages they serve up on the HTTP / HTTPS sockets.

Any feedback or suggestions are appreciated! I’m seeking to document this since DreamHost is a relatively popular service and there seems to be very little info available on how to use a non-vanilla node.js server via their services…

Well, you can try to follow this tutorial Deploy Node.js application using Passenger on Dreamhost or other hosting providers and make a app.js file in your project’s root folder, just copying the server.js content.

If Dreamhost sets everything right, you should have the server port and address in 2 environment variables, called: HOST and PORT.

I never used Dreamhost, but I strongly recommend you to use Heroku’s service, or a custom VPS for that.