How can I add a subdomain to my website?

Posted February 17, 2016 15.3k views

I want to have instead of
How can I make it happen?

I own a Ubuntu 14.04 x64 droplet.

My droplet has everything from the “Initial Server Setup with Ubuntu 14.04” tutorial.

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

Hey there,

You would create a virtual host for the domain pointing to a different folder than your’s document root. This tutorial reviews setting up virtual hosts (multiple websites) for Apache running on Ubuntu.

You would also need to create an A record in your DNS zone pointing artwork to your IP address.

Happy coding,

Jon Schwenn
Platform Support Specialist

by Justin Ellingwood
The Apache web server is the most popular way to serve web content on the internet. Apache has the ability to serve multiple domains from a single server by using a mechanism called "virtual hosts". If a virtual host is configured correctly for each domain, the web server can correctly route traffic to the appropriate files based on the domain name requested. In this guide, we'll demonstrate how to configure Apache virtual hosts on an Ubuntu 14.04 VPS.
  • Now am in the stage where I have up and running and I can access it in a web browser with no problem. However, I did not do any A record thingy. Do I need to do it, if so how?

    • There are a few reasons why it may work without creating an A record:

      1. You hardcoded in your hosts file
      2. You have a wildcard CNAME or A record

      As long as it’s working regardless of the computer/internet connection, I would leave it be :)

  • Hi, there!

    Do you mean that for every subdomain like or, I need to create a new virtual host every time? Thanks in advance!