How To Launch Your Site on a New Ubuntu 12.04 Server with LAMP, SFTP, and DNS

Published on November 28, 2012
How To Launch Your Site on a New Ubuntu 12.04 Server with LAMP, SFTP, and DNS

Status: Deprecated

This article covers a version of Ubuntu that is no longer supported. If you are currently operate a server running Ubuntu 12.04, we highly recommend upgrading or migrating to a supported version of Ubuntu:

Reason: Ubuntu 12.04 reached end of life (EOL) on April 28, 2017 and no longer receives security patches or updates. This guide is no longer maintained.

See Instead:
This guide might still be useful as a reference, but may not work on other Ubuntu releases. If available, we strongly recommend using a guide written for the version of Ubuntu you are using. You can use the search functionality at the top of the page to find a more recent version.


This article will take you from a fresh, new server to an online, working site. There are a variety of tutorials in our Community that separately will help you accomplish each step in the process. The following article will combine the relevant articles into a cohesive step by step to guide to set up your personal site on an Ubuntu server.

Step One—Create your Server

The first step to getting your site online is creating your VPS. You can find the information on how to launch your cloud server in our Getting Started Tutorial

Step Two—Basic Server Setup

After you have created your first server, you can start to secure it and create new users. Although this step is not required, nor are all the changes made in the tutorial necessary, it will begin to secure your server: Initial Server Setup.

Step Three—Install LAMP

Subsequently, we need to start setting up the server programs. A strong foundation for the server is the traditional LAMP stack: Linux (automatically installed on the server), Apache, MySQL, and PHP, a web server, database server and programming language, respectively.

Prior to setting up our personal site, we need to be sure that LAMP Stack is installed on the server.

Step Four—Set Up Your Domain

In order to ensure that your site will be up and visible, you should set up your DNS to point your domain towards your new server. The basic setup is almost all automatic, requiring you to only enter your domain and the IP address of the server that you are looking to host your site on.

You can find more information on Setting Up a Hostname by following the link.

Step Five—Connect with SFTP

Now your site should be up and connected, and, once the records have propagated, you should be able to see the standard Apache, "It Works!" page by visiting your domain in the browser. If you would like to visit your site before the records have been updated, you can access it by typing your server's IP address in the browser. Now it is time to bring out the big guns: ie. Customizing your setup so that you can upload your own pages to your site. In order to do this, you need to install and configure an SFTP client.

Filezilla is a great program to use.

You can download Filezilla from their site.

Once it’s downloaded and installed, start it running.

To begin transferring files, open up the Filezilla and within the file manager, open up the site manager options:

  1. Click on the new site button. You can double click the name of the entry to change the name
  2. Put your domain name (or IP address if your domain has not propagated yet) in the host field
  3. Fill in your username and password with the username “root” and the password you set earlier
  4. Click connect

Clicking connect will now allow you to transfer files from your computer to your server and build your site: be sure to drag them from your local directory on your left into your web directory (very likely /var/www) in frame on the right:

By Etel Sverdlov

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the authors

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?

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!

I believe there are some missing steps here. Specifically the need to give public read access to the /var/www/ directory or visitors will be prompted for a password by default.

Can you confirm if this is the case and the process for adjusting permissions in Apache or .htaccess?



HI, I need some assistance. I have a new computer and am setting up my Filezilla. I forgot my old password for my droplet and requested a new password. I also at the prompting power cycled.

Received password in my inbox. So I have setup my host IP address. Set my Port Logon Type: Normal User: root Password: is the new Password

However, this is my error.

Command: Pass: ************ Status: Connected to xxx.xxx.xxx.xxx (changed this) Error: Connection closed by server with exitcode 1 Error: Could not connect to server

Can anyone offer a suggestion?>

I did everything correctly in the tutorial, but to get to my /var/www I had to go to the advanced tab of FileZilla and set it as the default remote directory.

Im calling this:-> <?php session_start(); if (!empty($_SESSION[‘userdetails’])) { header(‘Location: nextpage.php’); } require ‘myclass.class.php’; require ‘myclass.config.php’; $loginUrl = $myclassvar->getLoginUrl(); ?>

using -->

href=“<? echo $loginUrl ?>”

but it is not giving value of $loginUrl … and giving this error “The requested URL /< was not found on this server.”

please help

To download, Upload and Delete file from SFTP check video below: https://www.youtube.com/watch?v=VVqh0BCgFpM

@Andrew SB, thank you very much… now it is clear to me

Andrew SB
DigitalOcean Employee
DigitalOcean Employee badge
May 21, 2014

@deepblue.designs: That’s only if you want to use phpMyAdmin. It makes the web interface available. See: https://www.digitalocean.com/community/articles/how-to-install-and-secure-phpmyadmin-on-ubuntu-14-04

thank you Andrew, now it works :)

another question on another topic, if you please in other tutorial we were told to put “Include /etc/phpmyadmin/apache.conf” inside apache2.conf , what its needed for?

Andrew SB
DigitalOcean Employee
DigitalOcean Employee badge
May 21, 2014

@deepblue.designs: Are you using Ubuntu 14.04? If so, you need to put the files in <code>/var/www/html</code>

Hi, I did all all the instructions mentioned in getting started tutorial, but I still can not see my actual website pages, I only see it works default page.

I did install lamp, configure DNS, configure vsFtp, uploaded my files to var/www

when I open my domain I cant see my index.php, what did I miss?


Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel