Tutorials  /  Linux Basics

Manage WordPress via WP-CLI on a LAMP Server Easily

Ccentron Redaktion · July 2025 ·3 min read ·Linux Basics, Tutorial

WP-CLI is a powerful command-line interface specifically built for WordPress site management. Whether you maintain a single website or oversee dozens, WP-CLI provides a fast, scriptable way to handle updates, configurations, and common tasks without accessing the browser-based admin panel. It’s especially useful for developers and system administrators who prefer automation or need to manage sites remotely.

This walkthrough assumes you already have WordPress running on a standard LAMP (Linux, Apache, MySQL, PHP) server.

Step 1: Downloading and Setting Up WP-CLI

To begin managing WordPress with WP-CLI, first download the tool using the following commands:

Console
cd ~
curl -k -L https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar > wp-cli.phar

To confirm the tool is functioning correctly, execute:

Code
php wp-cli.phar --info

This should return PHP environment details.

VM

Matching infrastructure at centron

No hardware needed to follow along: ccloud³ VMs with full root access start at €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

Step 2: Adding Alias to .bashrc File

For easier command access, define an alias by editing the ~/.bashrc configuration file. Append this line to it:

Code
alias wp="php /home/USERNAME/wp-cli.phar"

Apply the changes immediately by running:

Code
source ~/.bashrc

Step 3: Executing WP-CLI Commands

To utilize WP-CLI, switch to the directory where your WordPress site is stored. You can now execute WP-CLI instructions within that directory. For example, use the command below to upgrade your WordPress installation:

Code
wp core update

To discover the complete list of available WP-CLI commands, consult the official WP-CLI documentation online.

Conclusion

WP-CLI significantly enhances the way developers and administrators interact with WordPress installations. By removing the need to navigate through the web-based admin dashboard, it empowers you to automate, script, and streamline routine maintenance and deployments. This not only saves time but also reduces the risk of human error.

Whether you're applying core updates, installing plugins, or managing databases, WP-CLI can handle it all from the terminal. Once you’re comfortable with the basics, you’ll find endless ways to incorporate WP-CLI into your workflow. Explore the official documentation for advanced usage, or integrate it into scripts to supercharge your WordPress management strategy.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Linux Basics
Teilen
Noch offene Fragen?

Unser Team hilft Ihnen bei Ihrem konkreten Setup weiter – von Menschen, die die Plattform selbst betreiben.

War dieses Tutorial hilfreich?

Ihre Antwort wird anonym gespeichert und hilft uns, die Tutorials zu verbessern.

Kommentare

Noch keine Kommentare – stellen Sie die erste Frage zu diesem Tutorial.

Zum Kommentieren anmelden

Kommentare stehen centron-Kunden offen. Melden Sie sich in Ihrem Konto an, um eine Frage zu diesem Tutorial zu stellen.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren