Free Tier: Install Apache and PHP on an Ubuntu VM
In this tutorial, you use an Oracle Cloud Infrastructure Free Tier account to setup an Ubuntu 18.04 virtual machine (VM). Then, you install an Apache web server and PHP and access your new server from the internet. Finally, this tutorial covers all the steps necessary to setup a virtual network for your host and connect the host to the internet. Key tasks include how to:
- Setup
ssh
encryption keys to access your Ubuntu Server. - Setup an Oracle Cloud Infrastructure virtual cloud network (VCN) and related network services required for your host to connect to the internet.
- Install your Ubuntu 18.04 VM and connect it to your VCN.
- Configure Apache and PHP 7 on your VM.
- Connect to your VM from the internet.
Here is a simplified diagram of the setup for your Linux VM.

For additional information, see:
Before You Begin
To successfully perform this tutorial, you must have the following:
- An Oracle Cloud Infrastructure Free Tier account. See Oracle Cloud Free Tier.
- A MacOS or Linux computer with
ssh
support installed. - A Windows machine with PuTTY installed. See the the PuTTY site for more information or to download.
1. Create SSH Encryption Keys
Create ssh
encryption keys you can use to log into your VM.
You have generated the required encryption keys.
Follow this link for more detailed information on generating ssh
encryption keys.
2. Create your Virtual Cloud Network (VCN)
Setup a VCN to connect your Ubuntu instance to the internet. You configure all the components needed to create your virtual network.
3. Install your Ubuntu VM
Install your Ubuntu VM to host your Apache web server.
4. Install and Configure Apache and PHP
Next, install and configure Apache web server and PHP to run on your Ubuntu Linux VM.
To install and setup Apache and PHP, perform the following steps:
What's Next
You have successfully installed and deployed an Apache web server on Oracle Cloud Infrastructure using a Linux VM.
To explore more information about development with Oracle products check out these sites: