How to "publish" website?

rails
workspace
ruby

#1

Is there a way to publish my app? To go on it, a user has to be signed on Cloud9 and then I need to run the code on the terminal…

rails server -b $IP -p $PORT
How would I be able to publish my website? I am very new to rails and I have no idea.


#2

Unfortunately, Cloud9 is not a hosting solution, so you’ll need to find a VPS (virtual private server) host. These are very common, I would suggest any of the following (in no particular order): Amazon Web Services EC2, Google Cloud Platform, Microsoft Azure, Linode, or DigitalOcean. I personally prefer AWS EC2, because you can get a free VPS for 12 months, but the others are also just as excellent (it’s worth noting that Cloud9 integrates very well with Google Cloud Platform). Once you have a VPS, you can SSH into it, clone your GitHub repository, and run your server. I did find a tutorial that you might find useful, it uses DigitalOcean but the process is similar for the other VPS providers.


#3

I use Digital Ocean VPS to run web apps and I followed this tutorial to set up deployment using Git. Obviously, this will mean signing up with Digital Ocean and creating a VPS. However, the tutorial can be applied to any VPS setup. Since we are using a C9 workspace, you need to replace “Local machine” with your C9 workspace.

If you have a database, you may need to replicate it manually (git does not track the database) on the new host of your app.

If you are using environment variables (I use it so that I don’t commit database login credentials and API keys to git), you will also need to set them up on your VPS.

Digital Ocean also allows you to manage DNS records, so you can buy a domain name and point it to their name servers and take it from there.

I do not work for Digital Ocean, just been happily using their services for the past 3 years.


#4

So, do you create the VPS before following the tutorial? If so, how do you create it?


#6

@dbock3 If you are working with Rails I would suggest you take a look at Heroku. Very easy to setup and push your application into production.


#7

Hey, I’m stuck now. I posted a question on stacker flow, don’t feel like posting it again, but the link is at https://stackoverflow.com/questions/44703107/deploying-website-issue-stuck-installing-nginx