Install LAMP Server on Ubuntu 18.04 Bionic Beaver

Hello everyone, welcome to my Ubuntu Tutorial. Today, we are going to learn how to install LAMP Server on Ubuntu 18.04 Bionic Beaver. LAMP Server is a popular way to build your own web server. After you have LAMP Server on your server, we can then install many web applications such as Owncloud, Nextcloud, WordPress and many more. At the time I wrote this article, Ubuntu 18.04 Bionic Beaver is still in the development version. But I think this tutorial still valid even after the final release is out. So, let’s get started. 

Steps to install LAMP Server on Ubuntu 18.04 

Step 1. Install Apache web server

First, we are going to install Apache web server on Ubuntu 18.04. Use the following command to install Apache on Ubuntu.

sudo apt install apache2

Output:

dhani@ubuntu-server:~$ sudo apt install apache2
[sudo] password for dhani: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap liblua5.2-0 ssl-cert
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom openssl-blacklist
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1
  libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.2-0 ssl-cert
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,727 kB of archives.
After this operation, 6,994 kB of additional disk space will be used.
Do you want to continue? [Y/n]

Now open a web browser and type the server IP address. For example:

192.168.1.9

You should see something like this

install lamp server on Ubuntu 18.04

Step 2. Install MariaDB Server

Now we are going to install MariaDB Server on Ubuntu 18.04. Please also read my other tutorial to install MariaDB on Debian 9 Server. But anyway, you can use this simple command to install it.

sudo apt install mariadb-server mariadb-client

 

Secure MariaDB

sudo mysql_secure_installation

Please follow on screen installation wizard. You will be asked to change password for root user etc. 

Start MariaDB Service

sudo systemctl start mariadb

OK at this point, MariaDB is ready. 

Step 3. Install PHP

Next, we are going to install PHP on Ubuntu 18.04. 

sudo apt install php php-mysql

Output

dhani@ubuntu-server:~$ sudo apt install php php-mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libapache2-mod-php7.1 php-common php7.1 php7.1-cli php7.1-common php7.1-json
  php7.1-mysql php7.1-opcache php7.1-readline
Suggested packages:
  php-pear
The following NEW packages will be installed:
  libapache2-mod-php7.1 php php-common php-mysql php7.1 php7.1-cli php7.1-common
  php7.1-json php7.1-mysql php7.1-opcache php7.1-readline
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,790 kB of archives.
After this operation, 15.1 MB of additional disk space will be used.
Do you want to continue? [Y/n]

Ok done. Now we have installed Apache web server, MariaDB and also PHP. Now our Ubuntu 18.04 is ready for powering up some web applications. Thanks for reading this post, please share if you think this was useful and leave us comments if any query. Cheers.

1 Comment

  1. I’m so frustrated! I’ve “followed” a dozen tutorials, ALL FAIL. Yours go me this far:
    Error

    PHP module zip not installed.

    Please ask your server administrator to install the module.

    PHP module dom not installed.

    Please ask your server administrator to install the module.

    PHP module XMLWriter not installed.

    Please ask your server administrator to install the module.

    PHP module XMLReader not installed.

    Please ask your server administrator to install the module.

    PHP module libxml not installed.

    Please ask your server administrator to install the module.

    PHP module mb multibyte not installed.

    Please ask your server administrator to install the module.

    PHP module GD not installed.

    Please ask your server administrator to install the module.

    PHP module SimpleXML not installed.

    Please ask your server administrator to install the module.

    PHP module cURL not installed.

    Please ask your server administrator to install the module.

    PHP modules have been installed, but they are still listed as missing?

    Please ask your server administrator to restart the web server.

    Does anyone know how to write install instructions that work???

2 Trackbacks / Pingbacks

  1. Cauti Installing Lamp Ubuntu 18?
  2. How to Install LAMP Server on Fedora 31 | Manjaro dot site

Leave a Reply