Hostwinds Tutorials

Search results for:


Table of Contents


Install Apache
Install MySQL
Install PHP

Install LAMP Stack Manually (Ubuntu)

Tags: Ubuntu 

Install Apache
Install MySQL
Install PHP

Make sure your server is up-to-date.

The LAMP stack is a development stack that is common for PHP-based websites and web applications. LAMP stands for Linux, Apache, MySQL, PHP.

Install Apache

You will want to run the following command to install Apache:

apt-get install apache2 -y

Running this command with the -y option will automatically proceed through any installation parts that would prompt you for a yes/no answer.

Test your installation by opening a web browser and navigating to HTTP://\

Install MySQL

Run this command to install MySQL. Once again, we are using the option:

apt-get install mysql-server -y

It is highly recommended to set the root password for MySQL after installation. You can use the following steps to change the password:

Stop MySQL:

/etc/init.d/mysql stop

Start MySQL configuration:

mysqld --skip-grant-tables

Start MySQL:

/etc/init.d/mysql start

Make sure MySQL is running:

/etc/init.d/mysql status

Log in to MySQL:

mysql -u root -p

Change the root password:

UPDATE user SET authentication_string=password('YourPassword');

Type "quit" to exit MySQL.

Install PHP

PHP is the server-side scripting language that gives your application or website the ability to interact with the server. To install PHP, run the following command:

apt-get install php libapache2-mod-php php-mbstring php-mysql -y

To verify the installation of PHP, you can check your version with this command:

php -v

Written by Hostwinds Team  /  June 14, 2019