Ask A Question

Notifications

You’re not receiving notifications from this thread.

Could I deploy two different apps on the same server?

Ali Hamdi Ali Fadel asked in Servers

Hello everyone,

Yesterday, I started using HatchBox to deploy my Rails applications and it is working just fine.

I was thinking about deploying 2 Rails applications on the same Vultr | 1GB RAM | 1 vCPU instance, known that the 2 applications will be used by <1000 users per month, and one of them is not DB intensive application. Do you have any thoughts about this?

Also, is there any special setup to do? Or I should just create new App in HatchBox and deploy it to the same server?

Thanks in advance!

Reply

Hey Ali!

It's up to you really. If you want to save money, deploying to the same cluster is the way to go.

If you plan to scale the apps up independently in the future, you would want to start with 2 servers and deploy the apps separately. That way you can add more servers to one cluster, but not the other.

That's usually how I decide if I want 1 or 2 different clusters. Does that make sense?

Reply

Hello Chris,

It makes sense, but my question is that we don't have to do any extra setups, right? Just create new app and deploy it to the same server?

Another question, is it easy to migrate from one server for 2 apps to 2 different servers one for each app?

Reply

Shouldn't be any extra setup. Are there any specific setup things you're thinking about?

Moving from 1 server to 2 servers requires you to move DNS and your database to the new server. So you will probably have some downtime, but it's not hard to do. You can put the app in maintenance mode while you do it so that users know you're migrating.

Reply

No nothing special I'm thinking of, I was just making sure that I'm understanding the process correctly. Although, one thing is questionable for me, will HatchBox handle the port thing itself? Like booting one app on 9000 and the other on 9001?

Reply

BTW Chris, I think there is a bug (or a feature :3) in GoRails forum. When I publish a new question, my old question disappears from the All Threads listing. This is my new question: gorails . com/forum/where-to-store-images-a758fc64-78b7-472d-9ddb-899d71522c09, and this is the old one: gorails . com/forum/could-i-deploy-two-different-apps-on-the-same-server-90fca78a-8dac-481f-957c-2a9b902a4dd4 (The current one).

Also, only one of them appears in My Questions listing.

I put spaces as you detected that I'm a spammer, sorry :3

Reply

Yep! Hatchbox will automatically set PORT different for each app. 👍

Reply

Deploying two different apps on the same server is totally doable, especially if they have low usage and aren't too resource-intensive. Since you're using HatchBox, you can simply create a new app and deploy it to the same server without any special setup.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,464+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.