ubuntu server setup This is the ultimate guide how to build, setup and config Ubuntu-based unmanaged web server on VPS or Dedicated servers. Very complete tutorials for newbie. Finally I feel all the tutorials are completed and ready for you to build your own very first production web server on Ubuntu. My goal writing this blog is to guiding newbies who were afraid to switch from Shared hosting environment to unmanaged Virtual Private Server (VPS) or even Dedicated ones so they can now build a working live server to host their websites, forums and blogs in it.

Many newbies are still having a perception that purchasing a VPS plan is quite expensive because a user has to pay for cPanel license and managed service provided by the vendor. For your information, not all VPS are pricy. Most common unmanaged servers are much cheaper than managed ones. So here’s I write all necessary steps to build your own so you can simply throw away your fear.

My last hope, you have to be more than capable and brave to start your first step to build a production server to host your websites without having to purchase management service for your tiny little server. At least, I hope by reading this ultimate guide can be your first step to learn more advanced method to manage and secure your server.

Before you proceed, these are basic skills you have to master or at least know part of it:
How to use Putty (Windows) – Mac and Linux use Terminal
Most popular and common commands use in SSH-ing a server

Basic Guides

1. Basic Ubuntu Setup Before Building A Working Server

This article shows you most common practice and essential setup to build Ubuntu web server.

2. How to Install a Web Server, PHP5 and MySQL on Ubuntu

2.a How to Install LAMP Stack
LAMP stands for Linux, Apache, MySQL and PHP. Ubuntu itself is a Linux. So what you gonna need are:
How to install Apache web server and PHP5
How to install MySQL database server

2.b How to Install LNMP / LEMP Stack
LNMP stands for Linux, Nginx, MySQL and PHP. Sometimes it also called LEMP which stands for Linux, Engine X, MySQL and PHP. Ubuntu itself is a Linux. So what you gonna need are:
How to install Nginx web server and PHP5
How to install MySQL database server

Necessary read:
Top Most Common Basic MySQL Commands

2.c How to Automatically Install LAMP or LNMP stack (your choice)
This method is faster way than above manual methods but not so recommended if you want to learn more. Because everything is automatic, this could be your solution if you wish to build a server in a snap.
Easiest Way To Install LAMP and LNMP Stack On Ubuntu

More To Do With Your Server

1. Install A Mail Server

A mail server is necessary for your site to be able to send emails like confirmation, login credentials, etc. For that purpose Postfix is the perfect choice.
Easy Way To Install Postfix On Ubuntu Server

2. Connecting Your Domain To Server

Once you setup your server, you may also need to connect your domain so it can resolve to your server. This is basically can be done via DNS Manager provided by your Registrar. Big company like GoDaddy and NameCheap provide that feature. Alternatively, if you wish your domain has its own Name Server like ns1.domain.com and ns2.domain.com, read my guide about installing BIND DNS server:
How To Install and Setup Bind9 On Ubuntu Server

3. Uploading Files to Server

Since the server has no cPanel or any other Control Panel software installed, so you won’t find any File Manager. All files upload and management tasks can be done via FTP:
Using SFTP To Upload and Manage Files On Your Server

Setting Up Your Site Into Server

If you are familiar enough with cPanel (or any similar panels), to add new website in it you can simply use the Addon Domain function or if in WHM you can simply create new cPanel account for each new site. But the case is really different in a server without cPanel. For that read:

1. Add New Site To Apache-based Server

This tutorial will guide you how to add new site and domain to your Ubuntu server with Apache and PHP5. That includes how to add Apache virtual hosts file.
How To Add New Website On LAMP Server

1.1. How To Install WordPress on Apache
How To Install WordPress On Apache-based Ubuntu Server

2. Add New Site To Nginx-based Server

How To Add New Site Into Your Nginx-based Ubuntu Server

2.1. How to Install WordPress on Nginx
How To Install New WordPress Blogging Script On A Nginx-based Ubuntu Server

2.2. Nginx Virtual Hosts Config for W3 Total Cache Plugin
How to Setup Nginx Virtual Host For WordPress With W3 Total Cache

2.3. Nginx Virtual Hosts File Config for WP Super Cache Plugin
How to Setup Nginx Virtual Host For WordPress With WP Super Cache

3. Website Migration: cPanel to Server

Instead of creating your new site from scratch on your server, you can simply move your production site from cPanel (shared hosting) to the new server you build. I posted a nice easy-to-understand tutorial how to fast moving your site. This guide will show you how to move or migrate a website from cPanel to the unmanaged server you’ve setup. The word “Server” here refers to either VPS or Dedicated server.
How To Move Website From cPanel-based Hosting To Your Server

Basic Security

1. Restrict Number of Simultaneous Connections Allowed

This guide will show you how to limit the number of maximum connections coming from a single IP to your server to avoid traffic flooding. This way you can restrict the number of maximum connections allowed for a single IP to your server via port 80 (default http port).
How To Limit Maximum Connections In Your Server

2. Avoid Brute Force Attack with Fail2Ban

In this tutorial I’ll try to explain necessary steps how to install Fail2ban and some basic configurations. Once detected a brute force attempt, Fail2ban will simply update firewall rules to reject the IP address automatically and lock that IP from your server for defined amount of times.- How To Install Fail2Ban To Protect Server From Brute Force SSH Login Attempts

More With Ubuntu Server (Advance)

1. Install, Setup and Configure Varnish Cache with Apache

This tutorial will tell you how to install Varnish Cache 3 HTTP accelerator and configure it to run with Apache 2 on Ubuntu server.
Install Varnish 3 To Run With Apache 2 On Ubuntu Server

2. Install, Setup and Configure Varnish Cache with Nginx

Running Varnish in front of Nginx is not really suggested by official Varnish Dev Team because Nginx is already more than capable for handling static files. But however every body has its owned flavor and preference, so the decision is up to you. So if you decided to test how Varnish and Nginx can boost your server performance, simply read my guide:
Install Varnish 3 To Run With Nginx On Ubuntu Server

Shortcut / Quick Method

1. Complete Nginx Stack Installation Under 15 minutes with EasyEngine

Installing the whole package of LNMP/LEMP stack would be painful for non adventurous. Alternatively, EasyEngine comes in handy to install Nginx, PHP5-fpm (with OPCache), MYSQL database server, Postfix mail server, PhpMyadmin and WordPress.
Quick Install LNMP Stack Using EasyEngine

This page served as an Index to all my previous tutorial. I compile all of those articles related to Ubuntu-bsaed server setup here in this page. I will surely update this page each time I posted another article. Have a question or need more queries? Do not hesitate to contact me or write a comment below. Enjoy and do not forget to follow ServerMom in Twitter and also catch me on Google+.

Don’t forget, if you liked this ultimate guide, donate us a one click on this +1 button (need to login to Gmail / Google account first):