Skip to content
-
Subscribe to our newsletter & never miss our best posts. Subscribe Now!
The Server Admin
The Server Admin
  • Home
  • Linux
  • Windows
  • About
  • What Powers The Server Admin
  • Home
  • Linux
  • Windows
  • About
  • What Powers The Server Admin
Close

Search

  • https://www.facebook.com/
  • https://twitter.com/
  • https://t.me/
  • https://www.instagram.com/
  • https://youtube.com/
Subscribe
Linux

WordPress Command Line Install

By Anthony
March 24, 2024 2 Min Read
0

WordPress is a powerful tool that can now be used to create and produce much more then a “blog” or blog like site. You can now create so much that at last check it was above 40% of the internet now uses it as their main sites CMS. Read more here: https://colorlib.com/wp/wordpress-statistics/

So lets assume you have your vps all setup with a webserver running and you have your first page online and it says Hello World! Great, now what is the easiest way to get WordPress on your vps? I mean really before you had to create the db’s, import that db’s, download the core files, ftp or sftp them up to your server, run the installer, all that, and depending on your isp’s speeds it could take you an hour or so as now WordPress is thousands and thousands of files.

Well we no longer have to worry about this. Let me show you how its done.

So first thing we are going to do is connected to your vps, so go ahead and do this.

Now once connected lets run a few commands and then we can have our site on line in a matter of minutes.

So first lets get the WP-CLI Script installed.

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp

Great now lets then move into the directory we want the wordpress setup / installed to. In this example we will call it /home/sitedemo.theserveradmin.com. So do the following

cd /home/sitedemo.theserveradmin.com

I am getting ahead of myself, lets get that database setup first as we will need it here in another step

mysql
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT ALL ON wordpress.* TO 'wordpress_user'@'localhost' IDENTIFIED BY 'user_password';
EXIT;

Please adjust to your settings for your Database, User, and User Pass

Now we were going to run the following commands.

## Now lets get WordPress installed

wp core download

## Now lets populate the wp-config.php file

wp core config --dbhost=host.db --dbname=prefix_db --dbuser=username --dbpass=password


## Now lets change permissions of the wp-config.php file

chmod 600 wp-config.php

## Next we need to configure wp-config.php and replace information.
wp core install --url=https://yourwebsite.com --title="Your Blog Title" --admin_name=wordpress_admin --admin_password=4Long&Strong1 --admin_email=you@example.com


## That is it!  Your up and running!
## Now lets clear that history as we did past some passwords in clear text.

history -c && exit

Now that this is all done, assuming you have DNS configured correctly and pointed to your vps, you should now be able to access your website and start to build!

Author

Anthony

Follow Me
Other Articles
Previous

Caddy Webserver – Install

Next

WordOps

No Comment! Be the first one.

Leave a Reply

You must be logged in to post a comment.

Search

Need a Virtual Server for sysctl testing? Check out our plans!

Popular Posts

  • Mount sFTP folder as local drive
    by Anthony
    June 9, 2026
  • Robocopy Examples
    by Anthony
    February 12, 2026
  • Rsync Command Examples
    by Anthony
    February 10, 2026

Trending

  • Mount sFTP folder as local drive
    by Anthony
    June 9, 2026
  • Adding a GUI to a Server or VPS
    by Anthony
    August 27, 2024
  • Back up to a shared folder with Time Machine on Mac
    by Anthony
    January 4, 2025
  • Backup Your Databases
    by Anthony
    March 24, 2024

Editors Picks

    Send an email:
    mail@example.com

    Call me:
    123-456-7890

    • Facebook
    • Twitter
    • Instagram
    • TikTok
    • LinkedIn
    • Behance
    Copyright 2026 — The Server Admin. All rights reserved. Blogsy WordPress Theme