Website Deployment

Written by Art, June 27, 2017

Deployment is moving a website from a local environment to a server.

Connect to server

ssh root@ip

Install Apache2 on your server

sudo apt-get update

sudo apt-get install apache2

Add php libraris to send emails with a website php form

sudo apt-get install php libapache2-mod-php

apt-get install sendmail

Install git on your server

sudo apt-get install git

Create the directory structure

sudo mkdir -p /var/www/your_folder_name/public_html

Grant permissions

sudo chown -R $USER:$USER /var/www/your_folder_name/public_html

sudo chmod -R 755 /var/www

Get into your directory

cd /var/www/your_folder_name/public_html

Clone your project from your GitHub repo

git clone

Configure 000-default.conf file

sudo nano /etc/apache2/sites-available/000-default.conf

Add your path "/var/www/your_folder_name/public_html/your_project_repo" to index.html file to DocumentRoot

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/your_folder_name/public_html/your_project_repo
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

Restart Apache2 to make these changes take effect

    service apache2 restart

Go to browser use your ip address

Share with:

About author


Art is a FinTech enthusiast who has a great passion for coding and teaching. He earned a M.Sc. from Adelphi University, Garden City, New York. Currently, he develops software for the financial services industry and leads classes and workshops in Python at

Web Scraping w/Python Livestream

We go through the whole process of gathering, storing and analyzing data from the Web


Python Fundamentals

Easy way to learn fundamentals of Python for complete beginners