Hosting multiple platforms on single droplet.

Posted November 21, 2015 15.5k views


I would like to use Digital Ocean to host my online portfolio and I am wondering if it is possible to serve multiple web applications / pages from different server side platforms (node, php, java) through a single droplet.

I was thinking about using sub-domains like,, or pointing to different application containers on the Linux droplet, but im not sure if this is the most efficient way or even possible. Also open to using different routes like,, and

Am I needing to work with Apache? Port numbers? Routes? VPN?

Looking forward to receiving advice from the community or a Digital Ocean representative.


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
3 answers

Hi there!
Yes, you can definitely do this.
You will have to work with Apache (or any other web server [eg:- Nginx]).
Please look up “Virtual Hosts”.
I gathered a small list of existing DigitalOcean tutorials that could be of help to you.
Do let me know if you need anything else.

This link talks about wordpress sites on an ubuntu server (you havent mentioned what server youre using but this tutorial involves – apache, ubuntu, wordpress.

This link is the tutorial answer to the question you asked, except it uses Ubuntu and Nginx
Nginx is considered to be for slightly advanced users, so you would wanna check out apache first.

This link talks to you about setting up apache virtual hosts - as i mentioned earlier.

To conclude, I think that a thorough reading of all the three links should give you a firm answer to your question.
Let me know if you need anything else.

by Justin Ellingwood
WordPress is a popular content management system (CMS) that can be used to quickly launch blogs and websites. In this guide, we will discuss how to launch two separate blogs, each associated with their own domains, from one VPS.


You can definitely setup a Droplet and configure Apache/NGINX/Caddy/[insert-web-server] as your web server and run PHP, NodeJS, Python, Java or [insert-programming-language] as well. The only thing you’d need to keep in mind is the requirements for each.

If you’re going to run multiple environments, make sure you have the resources to handle them. I’d recommend at least a 2GB Droplet if this is the plan, especially if you plan on also using a database server (such as MySQL, MariaDB, Percona, Postgres etc).

The vast majority can be setup from the CLI using repository packages and either yum or apt-get (CentOS will use yum while Debian & Ubuntu use apt-get).

For example, to install NGINX + PHP-FPM on Debian/Ubuntu with support for MySQL (or any fork of MySQL, such as MariaDB / Percona), you’d issue the following commands from the CLI:

NOTE: Debian does not pre-install sudo, the package must be installed first. This isn’t required for Ubuntu. So if you choose Debian, you’d issue the first command to install the sudo package first and then proceed with the remaining commands. If you choose Ubuntu, simply omit the first command.

Installs sudo:

apt-get install -y sudo

Installs nginx:

sudo apt-get install -y nginx

Installs php-fpm:

sudo apt-get install -y php5-cli php5-fpm php5-dev php5-common php5-mysqlnd

Installs mariadb (a fork of MySQL):

sudo apt-get install mariadb-server

The NGINX configuration file will be located at:


An example server block configuration can be found in:


At this point, you would need to configure NGINX to utilize PHP by editing the server block (see the default example in the above directory for a basic guide) and then restarting NGINX:

sudo service nginx restart

And to ensure PHP-FPM is running:

sudo service php5-fpm start

Of course, there’s more to be done and this isn’t an all-inclusive guide. rather, a simple one to show you how to go about getting started without having to manually configure NGINX & PHP (though you can do that as well, it’s just a bit more time consuming).

  • or just use ServerPilot.

    • @aronjayvo

      While ServerPilot is an excellent service, although I have very limited experience with it, a control panel or control panel as a service type solution is no substitution for knowing how to work from the CLI. Auto-Installers and simplified deployment solutions will only take you so far unless you plan on hiring a server administrator to manage your server(s) for you.

      Beyond that, unless they’ve added to their service lineup, ServerPilot does not secure, optimize or perform the various day to day tasks of a server administrator for you, or on your behalf.

      VPS’s and Dedicated Servers are blank canvases and security and proper management is not an option, it’s a basic requirement when it comes to running a server.

      Even if you’re using cPanel or Plesk, the same applies.

Could it be done with the same domain but having different routes?

<VirtualHost *:80>
    DocumentRoot /var/www/
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

And the other one would be:

<VirtualHost *:80>
    DocumentRoot /var/www/
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

I’ve tried it and it didn’t really work :(