This guide intends to walk you through every step of a WordPress install. It was designed with NearlyFreeSpeech.NET hosting in mind, but may be helpful on other hosts as well.
Want an even faster way of installing WordPress? You can try the steps here if your server already has the wp cli installed. (You can run wp --info
to see if your server has the wp cli.)
- Use PuTTY to SSH into the server where you wish to install WordPress.
- Run
wget https://wordpress.org/latest.tar.gz && tar -xzvf latest.tar.gz
To get the latest install files for WordPress and unzip the wordpress folder.
- Run
rm latest.tar.gz
To delete the zipped folder.
- Run
cp -rp wordpress/* /home/684888.cloudwaysapps.com/bexgrkkbeu/public_html/
To copy the contents of the unzipped WordPress directory to the root directory of your server. You might have to use a path different than
"/home/684888.cloudwaysapps.com/bexgrkkbeu/public_html/"
depending on your particular server. - Run
rm -r wordpress
To delete the unzipped WordPress directory.
- Log into phpMyAdmin (or equivalent UI for your server’s MySQL Database).
- Click on “Databases”.
- Create a new database by providing a database name like “sitenamewp”, then clicking “Create”. WordPress recommends using “utf8mb4_general_ci” collation when creating a database. Write the database name down–it will be required later.
- Return to the main page by clicking phpMyAdmin logo in the top left.
- Click “User Accounts”
- Click “Add user account”
- Give the user a name like “wpuser_sitename” Write the user name down–it will be required later.
- Generate a password for the user by clicking the “Generate” button. Write the password down–it will be required later.
- Click “Go” to create the user.
- Go back to “User accounts”, then click “Edit privileges” for the recently created user.
- Click “Database”.
- Select the database that you created for this WordPress site, then click “Go”.
- Click “Check all”, then click “Go” to give this user all permissions on the selected database.
- Look at the top of the page and write down the host name for your MySQl server. It will look something like “hostname.db” and be found after the text “Server:”.
- Run
pico wp-config-sample.php
to begin editing the WordPress config file. The section of the file that you’ll focus on editing looks like this:
// ** MySQL settings ** // /** 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' );
- Replace the text that says
database_name_here
with the name of the database you created in step 9. - Replace the text that says
username_here
with the name of the user you created in step 13. - Replace the text that says
password_here
with the password you generated in step 14. - Replace the text that says localhost with the host name you made a note of in step 20.
- Optionally, add the line,
define('FS_METHOD','direct');
to thewp-config-sample.php
file immediately before the/* That's all, stop editing! Happy publishing. */
line. This can make WordPress, Theme and Plugin upgrades easier, but be sure you are aware of the security concerns before doing this. - Press CTRL + X to exit pico.
- Press Y to Save modified buffer.
- Change the “File Name to write” to
wp-config.php
, then press enter. - Leave PuTTY open, we’ll come back to it later.
- Visit
http://example.com/wp-admin/install.php
in your browser to run the install script using the config settings you provided. - Follow the on screen instructions to choose a title for your site, and set up the first user.
- Click “Install WordPress”.
- In PuTTY, run the following commands one after another:
cd wp-content mkdir -p uploads chgrp -R web uploads chmod -R 775 uploads cd ..
This should ensure that you can upload files to your site (based on recommendation here.)
- In PuTTY, run the following command:
touch .htaccess
This creates an empty
.htaccess
file, which can be used for setting up permalinks. - In PuTTY, run the following commands one after another:
chgrp -R web ../public find ../public -type f -exec chmod 664 {} \; find ../public -type d -exec chmod 775 {} \; chgrp -R web * find . -type d -exec chmod 775 {} \; find . -type f -exec chmod 664 {} \;
This will allow the web server to create and modify files. It also sets proper permissions for directories and files. It’s riskier than using the WordPress CLI from a security standpoint, but more convenient for WordPress users.
And that’s it! WordPress should be set up and ready to go!