First of all make sure that you have Apache, MySQL (or PostgreSQL), and PHP installed and configured on your system. On Ubuntu, you would type the following to install these applications:
sudo install apache2 sudo install mysql-server sudo install php5 sudo install php5-mysql
php5-mysql is required enable connectivity between PHP5 and MySQL. Create a MySQL root password for your database. Then install Moodle.
sudo install moodle
Follow the instructions. Once installation is complete, open your browser and go to http://localhost/moodle/admin. Follow instructions and voila! Moodle is ready to use.
If you get a “Forbidden Page” error, edit /etc/moodle/apache.conf and add the following line above allow from localhost:
Allow from * Allow from localhost
For more info on installing Moodle, go to http://docs.moodle.org/en/Installing_Moodle