Report this

What is the reason for this report?

Using 2 droplets for dev/staging and for production.

Posted on May 18, 2013

I’m about to get my first Digital Ocean droplet, but I have a few questions. Thanks in advance for your answers, this forums seems really great.

I’d like to have one droplet that will have a git server, MySQL database, and possibly staging environment.

Later when I’m ready to deploy my Rails app I’ll get another droplet just for Rails/NGINX/Passenger, etc. which will be the production environment.

Specific questions:

  1. I have only one domain name, which will be for the production droplet, so how do I communicate with the dev/staging droplet? Does Digital Ocean give me a unique IP for the dev/staging droplet?

  2. If DO does give me a static IP for my dev/staging droplet, how do I get my Rails app (on production droplet) to use the MySql database that is on the dev/staging droplet?

  3. Can I use Phusion Passenger to deploy to both the dev/staging droplet and to the production droplet?

  4. If I only have one domain name (for the production droplet), how will I access my Rails app deployed on the dev/staging server? Do I use some path that includes the DO provided static IP?

Sorry if this is a bit of a NOOB question, but I’m excited to have found Digital Ocean, and want to see if I can do what I’m hoping for. Thanks!



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

to answer the first question, each droplet has a unique ip adress. and if u want you can have a subdomain go to one droplet and then the www and the no sub domain go to another i believe

  1. Each droplet comes with a static dedicated IP address. <br>2) You can configure your app to connect to mysql on a specific IP (which would be the mysql droplet’s IP in your case) instead of localhost <br>3) Yes, you should be able to use Phusion Passenger without any problems. <br>4) You can access it directly by its IP. You can also create a dns record for dev.yourdomain.com to point to your dev box.

Hi there,

Quick update here in case that anyone comes across this in the future! Welcome aboard! It’s fantastic to see your enthusiasm for diving into the DigitalOcean ecosystem. Your plan for setting up development/staging and production environments is a solid approach, and I’m help clarify your queries.

  1. Unique IP for Each Droplet: Absolutely, Digital Ocean provides a unique IP address for each droplet. This means your dev/staging droplet and your production droplet will each have their own distinct IP addresses.

  2. Connecting Rails App to MySQL on a Different Droplet: To link your Rails app on the production droplet with the MySQL database hosted on your dev/staging droplet, you’ll need to point your Rails database configuration to the IP address of the staging droplet. Just ensure that your MySQL configuration on the dev/staging droplet is set up to accept external connections, particularly from your production droplet.

  3. Using Phusion Passenger: Yes, Phusion Passenger is a great choice and you can definitely use it for deploying your Rails app on both droplets. But I’ve personally used Capistrano instead!

  4. Accessing Your App on the Staging Server: Since you only have one domain name for your production environment, you can access your staging app directly using the IP address provided by Digital Ocean. For example, your staging app can be accessed via http://[staging-droplet-ip]:[port]. For added convenience, Digital Ocean’s DNS service allows you to create a subdomain like staging.yourdomain.com and point it to your staging droplet’s IP.

  5. Security Best Practices: It’s important to ensure your staging environment is secure and not publicly exposed. You might want to implement firewall rules to restrict access or configure your web server to only allow specific IPs.

  6. Consistency Between Environments: Aim to keep your staging environment as similar as possible to your production setup. This helps in reducing deployment issues and ensures smoother transitions from staging to production.

It’s great to have you in the Digital Ocean community, and I’m sure you’re going to do fantastic things with your setup. If you have any more questions or need further assistance, feel free to ask. Happy coding!

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.