If you're a beginner and want to launch your first website with WordPress, the first question that probably comes to mind is: "How do I install WordPress on my hosting?" Fortunately, today there are two main methods for installing WordPress: the manual method, which gives you full control, and the automatic method (quick install), which simplifies things for beginners. In this article, we'll teach both methods in full detail, and after installation, we'll review essential settings to keep your website secure and fast. If you're using shared hosting, both options are usually available; even if your hosting is from a provider like ServerNet, the steps are similar.
Method One: Automatic WordPress Installation with Softaculous (Quick Install)
The simplest way to install WordPress is by using automatic installation tools in your hosting control panel. The most common of these tools is Softaculous, which is found in most cPanel hosting plans. This method is ideal for those with little familiarity with FTP and databases.
Steps for Installation with Softaculous
- Log into your hosting control panel (cPanel). Its address is usually
yourdomain.com/cpaneloryourdomain.com:2083. - Look for the "Softaculous Apps Installer" section. If you don't see it, type "Softaculous" in the cPanel search bar.
- Click on the WordPress icon, then click the "Install" button.
- On the installation page, enter the following information:
- Protocol: If SSL is active, select
https://; otherwise, selecthttp://. - Domain: Select your domain from the list.
- Directory: If you want WordPress installed in the site root (e.g.,
yourdomain.com), leave this field blank. If you want it installed in a subdirectory (e.g.,yourdomain.com/blog), enter the folder name. - Site Name and Site Description: Enter your site's name and description (can be changed later).
- Admin Username and Password: Choose a strong username and password for logging into the WordPress dashboard. Do not use simple passwords like
admin123. - Admin Email: Enter a valid email address.
- Protocol: If SSL is active, select
- Do not change the default database settings unless you have expertise.
- Click the "Install" button. The installation process usually takes less than a minute.
- After completion, the login link to the dashboard (
yourdomain.com/wp-admin) and your user information will be displayed. Be sure to save this information.
Advantages and Disadvantages of Automatic Installation
Advantages: Fast, no technical knowledge required, automatic updates for WordPress and plugins in some versions.
Disadvantages: Less control over installation details, sometimes the database table prefix (wp_) cannot be changed, which can reduce security.
Method Two: Manual WordPress Installation (FTP + phpMyAdmin)
If you want full control over the WordPress installation process or your hosting does not support Softaculous, the manual method is the best option. This method involves three main steps: creating a database, uploading files, and running the installation script.
Step 1: Create Database and User
- Log into cPanel and go to the "MySQL Databases" section.
- In the "Create New Database" section, enter a name for the database (e.g.,
wp_site) and click "Create Database". - Scroll down and in the "Add New User" section, create a username (e.g.,
wp_user) and a strong password. Use the "Password Generator" button to create a random password. - Now, in the "Add User to Database" section, add the created user to the database, and in the pop-up window, select "ALL PRIVILEGES". Click "Make Changes".
- Note down the following information: Database Name, Username, and Password. This information will be needed during the WordPress installation step.
Step 2: Upload WordPress Files
- Download the latest version of WordPress as a ZIP file from
wordpress.org. - Extract the ZIP file on your computer. You will see a folder named
wordpress. - Log into cPanel and go to the "File Manager" section. Usually, the
public_htmlpath is your site root. - If you want WordPress installed on the main domain, upload all contents of the
wordpressfolder intopublic_html. If you want it installed in a subdirectory, first create a new folder (e.g.,blog) insidepublic_htmland upload the files into it. - Alternative method: You can use an FTP client like FileZilla. Get FTP information from the "FTP Accounts" section in cPanel.
Step 3: Run the Installation Script
- Open your browser and enter your domain address (e.g.,
yourdomain.comoryourdomain.com/blog). The WordPress welcome page will be displayed in English. - Select your desired language (Persian is available) and click "Continue".
- On the next page, enter the database information:
- Database Name: The name of the database you created in Step 1.
- Username: The database username.
- Password: The database password.
- Database Host: Usually remains
localhostunless your hosting uses a separate MySQL server. - Table Prefix: Change the table prefix from
wp_to something unique likexyz_. This increases security.
- Click "Submit". If the information is correct, you will see a success message for the connection. Click "Run the installation".
- On the next page, enter the site information and admin account:
- Site Title: The title of your site.
- Username and Password: For logging into the dashboard.
- Your Email: A valid email address.
- Search Engine Visibility: If the site is under development, enable this option so search engines do not index it.
- Click "Install WordPress". After a few seconds, a successful installation message will be displayed. Now you can click "Log In" to enter the dashboard.
Common Error in Manual Installation
Problem: After uploading files, a white screen or 500 error is displayed.
Cause: Usually due to incorrect PHP settings or an issue with the wp-config.php file.
Solution: Rename the wp-config-sample.php file to wp-config.php and edit the database information in it. Also, from cPanel, change the PHP version to 7.4 or higher (in the "Select PHP Version" section).
Essential Settings After WordPress Installation
After completing the WordPress installation, the work is not done. To have a secure and fast site, you need to make a few key settings.
1. Install SSL Certificate
SSL is essential for security and SEO. If your hosting supports free SSL (Let's Encrypt), go to the "SSL/TLS" section in cPanel and enable the "AutoSSL" option. After installation, in WordPress settings (Settings > General), change the site address to https://. You can also use the "Really Simple SSL" plugin to fix mixed content issues.
2. Change Permalinks
For better SEO, use the /%postname%/ structure instead of default URLs (like ?p=123). Go to "Settings > Permalinks" and select the "Post name" option. Then click "Save Changes".
3. Install Essential Plugins
- Security Plugin: Like Wordfence or iThemes Security. At least enable the firewall and malware scanner.
- Caching Plugin: Like WP Rocket or W3 Total Cache. Caching pages significantly increases site speed.
- Backup Plugin: Like UpdraftPlus. Schedule backups to be taken once a week.
4. Remove Default Users and Plugins
WordPress by default creates a user named admin and some sample posts and comments. Delete these to increase security. Also, remove unnecessary plugins like Hello Dolly.
5. Basic Security Settings
- Use a strong password for the admin account.
- Limit login attempts (using the Limit Login Attempts plugin).
- Protect the
wp-config.phpfile from public access. You can do this by adding the following code to the.htaccessfile:
<Files wp-config.php>
Order Allow,Deny
Deny from all
</Files>
Common Troubleshooting Tips
Error: "Error Establishing a Database Connection"
This error is usually due to incorrect database information in the wp-config.php file. Open the file and make sure DB_NAME, DB_USER, and DB_PASSWORD are correct. Also, check that the database host (DB_HOST) is usually localhost unless your hosting uses a separate server.
404 Error After Changing Permalinks
If pages show a 404 error after changing the permalink structure, simply go to "Settings > Permalinks" and click "Save Changes" again. This will rewrite the .htaccess file.
File Upload Problem (Maximum Size)
If you encounter an error when uploading images or large files, go to the "Select PHP Version" section in cPanel and increase the "Upload Max Filesize" option to your desired value (e.g., 64M). You can also do this by editing the php.ini file.
Summary
In this article, we taught two main methods for installing WordPress on hosting: the automatic method with Softaculous, which is suitable for beginners, and the manual method, which gives you full control. After installation, don't forget essential settings like SSL, permalinks, and security plugins. If you encounter any issues at any step, review the common errors and their solutions in the troubleshooting section. By following these tips, your WordPress website will be stable, secure, and fast.