Get the Best WordPress Backup
& Migration Plugin Today
Get Duplicator Now
Announcement Duplicator WP-CLI commands

Announcing Duplicator WP-CLI Commands (And How They Speed Up Backups)

Looking for a smarter way to manage site backups? Explore Duplicator's new features, including customizable WP-CLI commands and permission settings!
Install WordPress from SSH

How to Install WordPress From SSH Like a Pro (6 Steps) 

Written By: author avatar Joella Dunn
author avatar Joella Dunn
Joella is a writer with years of experience in WordPress. At Duplicator, she specializes in site maintenance — from basic backups to large-scale migrations. Her ultimate goal is to make sure your WordPress website is safe and ready for growth.
     Reviewed By: reviewer avatar John Turner
reviewer avatar John Turner
John Turner is the President of Duplicator. He has over 20+ years of business and development experience and his plugins have been downloaded over 25 million times.

Have you ever wished for a faster, more secure way to set up a WordPress site?

Welcome to the world of SSH installation.

SSH (Secure Shell) allows developers and system administrators to install WordPress directly from the command line. It’s like having a backstage pass to your server – quick, direct, and incredibly efficient.

This guide will walk you through every step of installing WordPress using SSH. Whether you’re a seasoned developer or an advanced user looking to level up your WordPress skills, you’ll find practical insights here.

We’ll cover everything from connecting to your server to configuring WordPress, all through secure, encrypted commands. By the end of this tutorial, you’ll have the confidence to install WordPress like a pro!

Ready to dive in and unlock a faster WordPress installation method? Let’s get started.

Table of Contents

What Is SSH?

Secure Shell (SSH) is a network protocol that lets you access and control a remote computer securely. Think of it like a secure tunnel between your local machine and a server.

Traditional internet connections are like sending postcards — anyone could potentially read them. SSH is more like a locked, encrypted message that only the intended recipient can open.

When you use SSH, all communication is encrypted. Your login credentials, commands, and data transfers will be protected from potential eavesdroppers. Hackers see nothing but scrambled, unreadable information.

SSH ensures your connection remains private. Every piece of data is transformed into a complex code that can only be decoded by authorized parties.

Developers rely on SSH for everything from server management to software deployments. It’s their Swiss Army knife of remote computing.

The beauty of SSH is its simplicity and security. With just a few keystrokes, you can securely control a server thousands of miles away.

Does WordPress Use SSH?

Let’s clear up a common misconception: WordPress itself doesn’t directly “use” SSH.

WordPress is a content management system that runs on web servers. It doesn’t inherently interact with SSH as part of its core functionality. Instead, SSH becomes a tool for managing WordPress behind the scenes.

Think of SSH as a backstage pass for your WordPress site. It doesn’t perform on stage, but it gives you critical access to set up, configure, and maintain your site.

Where SSH really shines is in WordPress management tasks. Tools like WP-CLI, a command-line interface for WordPress, rely heavily on SSH connections.

With SSH, you can:

You can use SSH to perform these tasks more efficiently than through a web interface. It’s faster, more precise, and allows for script-based automation.

So while WordPress doesn’t use SSH directly, SSH becomes an invaluable tool for WordPress site management.

Why Install WordPress via SSH?

Speed is the first major advantage. SSH installations are lightning-fast compared to traditional web-based methods. You can set up an entire WordPress site in minutes, not hours.

Security comes next. SSH provides an encrypted connection, protecting your credentials and data during the entire installation process.

Automation becomes a game-changer with SSH. Developers can create scripts that install WordPress consistently across multiple servers. Imagine deploying identical WordPress sites with just a few keystrokes.

Control is unparalleled. SSH gives you direct access to your server’s command line. You’re not limited by graphical interfaces or hosting control panel restrictions. Every aspect of the installation is at your fingertips.

Troubleshooting becomes easier. When something goes wrong, SSH allows you to dig deep into server configurations, run diagnostics, and resolve issues quickly.

For advanced users and developers, SSH isn’t just an installation method — it’s a powerful management tool.

How to Install WordPress From SSH

Installing WordPress via SSH might sound intimidating, but we’ll break it down into simple, manageable steps.

Step 1: Connect to SSH

Before you can install WordPress, you’ll need to establish a secure connection to your server. This is where SSH comes into play.

First, you’ll need your server’s connection details:

  • Username
  • Hostname or IP address
  • SSH password or key

To connect, open your terminal (on Mac/Linux) or use a tool like PuTTY (on Windows). The basic connection command looks like this:

ssh username@hostname

Replace username with your actual server username and hostname with your server’s address. For example:

ssh john@mywebsite.com

If this is your first time connecting, you might see a security prompt asking if you want to continue. Type “yes” to proceed.

You’ll then be prompted for your password. Enter it carefully — SSH is case-sensitive.

Pro tip: SSH keys are more secure than passwords. To generate an SSH key, use the command:

ssh-keygen -t rsa

This creates a public and private key pair, allowing passwordless login and enhanced security.

If you encounter connection issues, check these common problems:

  • Verify your internet connection
  • Confirm your username and hostname
  • Ensure your server allows SSH connections
  • Check firewall settings

Step 2: Install WP-CLI

WP-CLI is a command-line tool that lets you interact with WordPress without touching a web browser.

Most developers consider WP-CLI essential for efficient WordPress installations and management. Think of it as an easy, fast way to control your WordPress site directly from the terminal.

To see if your server already has WP-CLI, use this command:

wp cli version

If WP-CLI is installed, it will tell you what version is running.

To install WP-CLI for the first time, you’ll use a simple download command. Here’s how:

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

This downloads the WP-CLI installation file. Next, make it executable:

chmod +x wp-cli.phar

Then, move it to a location in your system path:

sudo mv wp-cli.phar /usr/local/bin/wp

To verify the installation, run:

wp --info

You should see a screen displaying WP-CLI version information and system details.

Pro Tip: WP-CLI works on Linux and macOS. Windows users might need additional setup or use Windows Subsystem for Linux (WSL).

If you encounter any issues during installation, double-check your PHP version and system permissions. WP-CLI requires PHP 5.6 or later.

Step 3: Download and Install WordPress

Now you’ll have no trouble installing WordPress using WP-CLI. You also won’t have to worry about file downloads or complicated extraction processes.

Use this WP-CLI command to download the latest WordPress version:

wp core download --path=/path/to/your/wordpress/installation

Replace /path/to/your/wordpress/installation with the actual directory where you want WordPress installed. This could be something like /var/www/mysite or /home/username/public_html.

If you want a specific WordPress version, you can add a version parameter:

wp core download --version=6.3 --path=/path/to/your/wordpress/installation

For developers who prefer more control, you can also manually download WordPress using wget:

wget https://wordpress.org/latest.tar.gz

tar -xzvf latest.tar.gz

A few quick tips:

  • Ensure the destination folder exists before downloading
  • Check you have sufficient disk space
  • Verify write permissions for the target directory

Step 4: Configure Your Database

Every WordPress site needs a database. This is where all your posts, pages, users, and settings will live.

First, you’ll need to create a MySQL database. Most hosting control panels offer this through phpMyAdmin, but we’ll focus on command-line methods.

Log into MySQL as the root user:

mysql -u root -p

Then create a new database for WordPress:

CREATE DATABASE wordpress_db;

Create a dedicated database user with a strong password:

CREATE USER 'wordpress_user'@'localhost' IDENTIFIED BY 'your_strong_password';

Grant this user full privileges on the new database:

GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wordpress_user'@'localhost';

FLUSH PRIVILEGES;

EXIT;

Step 5: Connect Your Site to the Database

Now it’s time to link WordPress with your newly created database. WP-CLI makes this process straightforward.

Use this command to create your wp-config.php file:

wp config create --dbname=wordpress_db --dbuser=wordpress_user --dbpass=your_strong_password --dbhost=localhost

Replace the placeholders with your actual database details:

  • wordpress_db: Your database name
  • wordpress_user: The database user you created
  • your_strong_password: The password for that user
  • localhost: Usually your database host (might differ on some hosting environments)

If you prefer manual configuration, you can also edit the wp-config.php file directly. Each database credential plays a crucial role:

  • Database name tells WordPress which database to use
  • Database user provides access credentials
  • Database host specifies where the database is located

Step 6: Configure WordPress

This is the final step in your SSH WordPress installation. You’re about to bring your site to life.

Use WP-CLI to install and configure WordPress with this command:

wp core install --url=yourdomain.com --title="Your Site Name" --admin_user=yourusername --admin_password=your_secure_password --admin_email=your@email.com

Replace these placeholders with your specific details:

  • yourdomain.com: Your actual website URL
  • Your Site Name: The title of your WordPress site
  • yourusername: The username for your admin account
  • your_secure_password: A strong, unique password
  • your@email.com: Your admin email address

After running this command, WordPress is fully installed and ready to go. You can now log into your WordPress admin dashboard using the credentials you just created.

Common Issues Installing WordPress From SSH

SSH WordPress installations aren’t always smooth sailing. Connection problems often stem from simple mistakes like incorrect login credentials, firewall restrictions, or outdated SSH configurations.

Always double-check your username, hostname, and ensure your IP isn’t blocked.

Permission errors can halt your installation in its tracks. The key is understanding file and directory permissions.

Use chmod commands to set the right access levels for WordPress files. Typically, chmod 644 for configuration files and chmod 755 for directories will resolve most permission-related headaches.

Compatibility issues with PHP versions or missing system dependencies can cause unexpected errors. A quick system check (verifying your PHP version and reinstalling WP-CLI) often resolves these technical hiccups.

Database connection problems are usually credential-related. Verify every detail: database username, password, hostname, and ensure the MySQL service is running. A single typo can prevent WordPress from accessing its database.

Frequently Asked Questions (FAQs)

How do I enable SSH on WordPress?

Enable SSH on WordPress by accessing your hosting account’s control panel and finding the SSH section. Activate SSH and copy the SSH credentials provided. Use an SSH client like PuTTY or Terminal to connect to your server using these credentials.

How do I install WordPress on an FTP server?

Download WordPress: Go to WordPress.org and download the latest version of WordPress. Extract the ZIP file to your computer.

Set Up FTP Access: Install an FTP client like FileZilla. Connect to your server using the FTP credentials provided by your hosting provider.

Upload WordPress Files: Navigate to the public_html (or equivalent) directory in your FTP client. Upload the extracted WordPress files into this directory.

Create a Database: Log in to your hosting control panel (like cPanel) and create a MySQL database. Note the database name, username, and password.

Run the WordPress Installer: Open your browser and go to your domain. The WordPress setup wizard will launch. Enter your database details when prompted and follow the on-screen instructions to complete the installation.

Login and Configure: Once installed, log in to your WordPress dashboard and start customizing your site!

With these steps, you’ll have WordPress running on your FTP server in no time.

How do I fix SSH permissions on WordPress?

If you’re encountering SSH permission issues on your WordPress site, here’s how to resolve them:

1. Verify File Permissions

Use the ls -l command to check file and directory permissions. WordPress recommends:

  • Files: 644
  • Directories: 755

Adjust permissions using this command:

bash

chmod 644 filename

chmod 755 directoryname

2. Check File Ownership

Ensure files and directories are owned by the correct user. For most setups, the web server user (e.g., www-data or apache) should own the WordPress files. Update ownership with:

bash

chown -R www-data:www-data /path/to/wordpress

3. Update SSH Keys

Make sure your public key is added to the ~/.ssh/authorized_keys file on the server.

Check that the private key on your local machine has the correct permissions:

bash

chmod 600 ~/.ssh/id_rsa

4. Check SSH Configuration

Ensure sshd_config on your server allows key-based authentication:

bash

nano /etc/ssh/sshd_config

Confirm PubkeyAuthentication yes is set and restart SSH:

bash

service ssh restart

5. Test the Connection

Use ssh -v user@server for a detailed log to debug any remaining issues.

If these steps don’t resolve the problem, consider reaching out to your hosting provider for further assistance.

Is SSH obsolete?

No, SSH (Secure Shell) is far from obsolete. It remains a cornerstone of secure remote access, file transfers, and system administration. SSH is widely used by developers, sysadmins, and hosting providers for its encryption and versatility.

Here’s why SSH is still relevant:

  • Security: SSH provides strong encryption, protecting data from unauthorized access.
  • Versatility: It supports multiple use cases, including tunneling, port forwarding, and secure file transfers via SCP or SFTP.
  • Integration: SSH integrates seamlessly with tools like Git, Ansible, and Docker for development and automation workflows.
  • Active Development: SSH protocols (like OpenSSH) are actively maintained, adapting to emerging WordPress security threats and evolving needs.

While newer technologies like Zero Trust Networking and remote desktop solutions offer alternatives, SSH remains unmatched for its lightweight, reliable, and secure functionality. It’s a critical tool in modern infrastructure management.

How do I install WordPress in localhost?

Setting up WordPress on localhost is a great way to test and develop your site. Here’s a quick guide:

1. Install a Local Development Environment

Download and install a tool like XAMPP, WAMP, or LocalWP. These tools include PHP, MySQL, and Apache/Nginx needed to run WordPress.

2. Download WordPress

Go to wordpress.org and download the latest WordPress package. Extract the files to the directory for your local server.

3. Set Up a Database

Start your local server and open phpMyAdmin (usually at http://localhost/phpmyadmin).

Create a new database (e.g., wordpress_local).

4. Configure WordPress

Open your browser and go to http://localhost/your-folder-name.

Follow the installation wizard. Enter the database name, username (root by default), and leave the password field blank (or as configured in your local setup).

5. Complete Installation

Fill in the site details like title, username, and password, then click Install WordPress.

You can now access your local WordPress site at http://localhost/your-folder-name.

Final Thoughts

Installing WordPress via SSH offers unprecedented control and efficiency. While the process might seem technical, it becomes straightforward with practice.

After you get familiar with SSH, you can simplify website backups with Duplicator’s new WP-CLI commands!

For quick backups, use this command: wp duplicator build

Duplicator will automatically back up your entire website. If you open your site dashboard, the new backup will be on the Backups page.

Use this command to learn how flexible Duplicator’s WP-CLI commands are:

wp duplicator build -- help

You’ll learn how to customize backups, the location your backups are saved, and the archive engine for creating your backups. All of this from the WordPress command line interface!

Whether you’re a developer looking for precision or a site owner wanting reliability, combining SSH skills with Duplicator can transform your WordPress management experience.

While you’re here, I think you’ll like these extra WordPress guides:

Ready to simplify your management tasks? Upgrade to Duplicator Pro for WP-CLI commands, automatic backups, drag-and-drop migrations, and more!

author avatar
Joella Dunn Content Writer
Joella is a writer with years of experience in WordPress. At Duplicator, she specializes in site maintenance — from basic backups to large-scale migrations. Her ultimate goal is to make sure your WordPress website is safe and ready for growth.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. We only recommend products that we believe will add value to our readers.