First install LAMP server in your ubuntu machine.For that follow our blog
Install required packages
#apt-get install php-curl php-gd php-mbstring php-mcrypt php-xml php-xmlrpc
Download wordpress tar file
#cd /
#wget -c http://wordpress.org/latest.tar.gz
Extract it
#tar -xzvf latest.tar.gz
Rsync the contents to /var/www/html
#rsync -av wordpress/* /var/www/html/
Set correct ownership and permissions
#chmod -R 755 /var/www/html/
# chown -R www-data:www-data /var/www/html/
#cd /var/www/html
Rename the file
#mv wp-config-sample.php wp-config.php
Create WordPress Database.We can either use phpmyadmin or follow set of mysql commands for it
#mysql -u root -p
mysql> CREATE DATABASE mywordpressdb;
mysql> GRANT ALL PRIVILEGES ON mywordpressdb.* TO 'mywordpressuser'@'localhost' IDENTIFIED BY 'redhat';
mysql> FLUSH PRIVILEGES;
mysql> EXIT;
#vi wp-config.php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');
/** MySQL database username */
define('DB_USER', 'username_here');
/** MySQL database password */
define('DB_PASSWORD', 'password_here');
/** MySQL hostname */
define('DB_HOST', 'localhost');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
Now restart the services
#systemctl restart apache2