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

Intro to Crypto & Blockchain

This course explains how to analyze, trade and build your own Blockchain tokens

Learn more

Python Immersive

Become a proficient Python programmer, master programming skills by working on real life projects

Learn more

Machine Learning Immersive

Today’s modern machine learning libraries have thoughtful APIs that allow anyone who is comfortable with code to dive into ML

Learn more

Javascript fundamentals

We speak to beginner coders on HOW TO GET STARTED as a developer as well as practice typing Javascript live coding

Learn more

Python 101

This class aims to help beginners to feel justifiably confident to start using Python programming language

Learn more