Hosting multiple platforms on single droplet.


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.


Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


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).

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.

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

  2. 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.

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

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 :(