I am an average Ubuntu user and currently i decided to strengthen my knowledge in Ubuntu. Since i am a web developer, lately i decided to setup my own web server powered by Ubuntu.

I just bought an unmanage VPS powered by Ubuntu 11.10. I have managed to install the Apache, PHP, MySQL and the basic security changes.

Previously, i was just a shared hosting user where everything is managed via cPanel which is easy. Now is totally different and i am clueless since i am on unmanaged VPS and of course the hosting company will not help me.

My question:

Previously, when I want to host new website, after I purchase a domain from registrar I will change the domain nameservers with my sharedhosting nameservers I just add the domain via cPanel. How can I host a domain/website on my new VPS? How to have a nameserver? How to setup the nameserver?


2 Answers 2


There are many "reasonable" and "practical" ways to go about hosting a website using your domain name on a VPS running Ubuntu.

I offer this guide for a straight-forward walkthrough on setting up a hardened Ubuntu LAMP Server to power a site: http://blog.al4.co.nz/2011/05/setting-up-a-secure-ubuntu-lamp-server/

In regards to setting up a Nameserver.... Just don't do that :) use the free dns services offered by most registrars or use a service like Afraid.org or Cloudflare to handle DNS.

  • Hi bkerensa, i already complete the LAMP part. My problem is how to make my VPS can host all my websites and domains. I even dont know how to use the free dns services you mentioned with my VPS. Most guides i found are just until setup the LAMP stack, and thats it.
    – DzulFriday
    Apr 23, 2012 at 9:34

To setup DNS server, you'll need to install a DNS server such as Bind. See instruction here https://help.ubuntu.com/community/BIND9ServerHowto However, like the other user suggested, you may want to just use the DNS service provided by a 3rd party since you will need at least 2 DNS servers, primary and secondary for it to work "properly". Your VPS provider may have DNS server available for you to use so contact them first before trying to setup your own.

To configure Apache/php/mysql to serve your site, see instruction here https://help.ubuntu.com/community/ApacheMySQLPHP

  • My VPS provider doesnt provide DNS server. But i register my domains at Namecheap and they have DNS server. Is that ok? If its OK, what are the steps to do this?
    – DzulFriday
    Apr 28, 2012 at 2:14
  • Yes, you can use their DNS servers. Find out from your VPS the IP address of your server, then go to NameCheap and add an "A record" (enter the ip address) for your domain name on their DNS server. That'll point your domain name to the ip address. Then on your VPS server, configure Apache for your web site. See the above link for instruction.
    – bobojam
    May 1, 2012 at 4:12
  • Thanks Bobojam! I can host many websites in my VPS right?
    – DzulFriday
    May 2, 2012 at 7:20
  • @DzulFriday yes you can host as many websites as you like on a VPS, as long as it doesn't run out of hard disk space or other resources. You can either set up separate Apache virtualhosts or have one virtualhost many names. See httpd.apache.org/docs/2.4/vhosts/name-based.html
    – bdsl
    Mar 21, 2017 at 20:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .