For setting up a WordPress on the system’s local server, we will be using the LAMP server stack. To install and set-up a LAMP server stack, you shall refer here.
Download the latest version of WordPress with the
.tar.gz extension. Make a directory and extract its file here.
To fetch the latest version, use:
This will download the compressed file in your working directory. Extract it in a new directory named
wordpress in your working directory, by:
tar xzvf latest.tar.gz
The official guide to set-up the WordPress using FTP is here. Since we are using the LAMP on the local server, we have already installed the requirements.
We will first restart our MySQL database and access the
root user. Each command will take a few seconds to process, so wait for it to complete.
$ mysqld restart $ mysqld -u root -p Enter password:
You can see the current databases by the following command in the MySQL prompt.
mysql> SHOW DATABASES;
Now, to create a new database named
CREATE DATABASE startwordpress;
OR use the phpMyAdmin by accessing it from http://localhost/phpmyadmin
Log in to the user by entering the username and password. Then, an interface would open. Go to Database > Create Database. Now, enter the name
wp-config-sample.php file from the WordPress directory.
// ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'startwordpress'); /** MySQL database username */ define('DB_USER', 'root'); /** MySQL database password */ define('DB_PASSWORD', 'password');
Type the following on the command line, to get the secure values as a response from the WordPress key generator. It will be different each time a request is made.
curl -s https://api.wordpress.org/secret-key/1.1/salt/
Copy the response values received in the following given code as a replacemnet to ‘put your unique phrase here’ corresponding to the respective fields.
. . . #define('AUTH_KEY', 'put your unique phrase here'); #define('SECURE_AUTH_KEY', 'put your unique phrase here'); #define('LOGGED_IN_KEY', 'put your unique phrase here'); #define('NONCE_KEY', 'put your unique phrase here'); #define('AUTH_SALT', 'put your unique phrase here'); #define('SECURE_AUTH_SALT', 'put your unique phrase here'); #define('LOGGED_IN_SALT', 'put your unique phrase here'); #define('NONCE_SALT', 'put your unique phrase here'); . . .
There are a lot of debates on whether the prefix affects the security of the WordPress. Though, it is a safe step. The prefix can be anything among numbers and letters, but the underscore at the end is compulsory.
$table_prefix = 'xlss2_';
Save the file as wp-config.php
Now, send the files from the current directory to the localhost server to continue with the configuration and setup the CMS.
sudo rsync -avP ~/wordpress/ /var/www/html/
Open http://localhost/wp-admin on the browser to continue with the remaining configuration by entering details like Site Title, Username, password, email, etc.
Now, log in to the browser and start using the WordPress CMS on the local server.