{"id":3756,"date":"2023-11-21T15:37:49","date_gmt":"2023-11-21T07:37:49","guid":{"rendered":"https:\/\/www.servergigabit.com\/guide\/?post_type=kb&#038;p=3756"},"modified":"2026-03-16T11:57:33","modified_gmt":"2026-03-16T03:57:33","slug":"installing-wordpress-linux-guide","status":"publish","type":"kb","link":"https:\/\/www.servergigabit.com\/guide\/kb\/installing-wordpress-linux-guide","title":{"rendered":"Installing WordPress: 10 Simple Steps to Launch Your Site"},"content":{"rendered":"<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-3758\" src=\"https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/m-300x169.jpeg\" alt=\"Installing WordPress\" width=\"698\" height=\"393\" srcset=\"https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/m-300x169.jpeg 300w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/m-1024x576.jpeg 1024w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/m-768x432.jpeg 768w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/m-1536x864.jpeg 1536w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/m-2048x1152.jpeg 2048w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/m-370x208.jpeg 370w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/m-1230x692.jpeg 1230w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/m-800x450.jpeg 800w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/m-390x219.jpeg 390w\" sizes=\"(max-width: 698px) 100vw, 698px\" \/><\/p>\n<div class=\"markdown markdown-main-panel\" dir=\"ltr\">\n<p data-sourcepos=\"7:1-7:244\"><a href=\"https:\/\/www.servergigabit.com\/wordpress-hosting\/\">WordPress<\/a> is a popular content management system (CMS) that allows users to create websites and blogs without extensive coding knowledge. This guide provides a step-by-step process for setting up a WordPress website on an existing <a href=\"https:\/\/www.linux.org\/\" target=\"_blank\" rel=\"noopener\">Linux<\/a> server.<\/p>\n<h2 data-sourcepos=\"9:1-9:18\"><strong>Prerequisites:<\/strong><\/h2>\n<ol data-sourcepos=\"11:1-13:0\">\n<li data-sourcepos=\"11:1-11:40\">A Linux-based server with root access<\/li>\n<li data-sourcepos=\"12:1-13:0\">A (sub)domain connected to the server (recommended)<\/li>\n<\/ol>\n<h2 data-sourcepos=\"14:1-14:21\"><strong>Installing PHP8.2<\/strong><\/h2>\n<p data-sourcepos=\"16:1-16:112\">PHP is required for WordPress to function. Install the latest PHP version, PHP8.2, using the following commands:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\">apt install sudo nano -y\r\nsudo apt install -y lsb-release ca-certificates apt-transport-https software-properties-common gnupg2 -y\r\n<span class=\"hljs-built_in\"><span class=\"citation-0\">echo<\/span><\/span> <span class=\"hljs-string\"><span class=\"citation-0\">\"deb https:\/\/packages.sury.org\/php\/ <\/span><span class=\"hljs-subst\"><span class=\"citation-0\">$(lsb_release -sc)<\/span><\/span><span class=\"citation-0\"> main\"<\/span><\/span><span class=\"citation-0 citation-end-0\"> | sudo tee \/etc\/apt\/sources.list.d\/sury-php.list\r\nwget -qO - https:\/\/packages.sury.org\/php\/apt.gpg | sudo apt-key add<\/span> -\r\napt update &amp;&amp; apt upgrade \u2013y\r\napt install php8.2 -y\r\n<\/code><\/pre>\n<\/div>\n<h2 data-sourcepos=\"27:1-27:21\"><strong>Adjusting php.ini<\/strong><\/h2>\n<p data-sourcepos=\"29:1-29:51\">Modify the php.ini file using the nano text editor:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\">nano \/etc\/php\/8.2\/apache2\/php.ini\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"35:1-35:32\">Adjust the following parameters:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">memory_limit = 1024M\r\nupload_max_filesize = 16G\r\npost_max_size = 16G\r\ndate.timezone = &lt;YourTimezone&gt;\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"44:1-44:54\">Replace <code>&lt;YourTimezone&gt;<\/code> with your actual timezone.<\/p>\n<h2 data-sourcepos=\"46:1-46:34\"><strong>Installing Additional Programs<\/strong><\/h2>\n<p data-sourcepos=\"48:1-48:58\">Install the required programs using the following command:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\">apt install apache2 unzip wget curl mariadb-client mariadb-server\r\n<\/code><\/pre>\n<\/div>\n<h2 data-sourcepos=\"54:1-54:25\"><strong>Setting up a Database<\/strong><\/h2>\n<p data-sourcepos=\"56:1-56:50\">Create a database and database user for WordPress:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\">mysql \u2013u root \u2013p\r\n<span class=\"citation-1 citation-end-1\">create database wordpress;\r\ncreate user \u2018wordpress\u2019@\u2019localhost\u2019 identified by \u2018PASSWORD\u2019;\r\ngrant all privileges on wordpress.* to \u2018wordpress\u2019@\u2019localhost\u2019;<\/span>\r\nflush privileges;\r\n<span class=\"hljs-built_in\">exit<\/span>;\r\n<\/code><\/pre>\n<\/div>\n<h2 data-sourcepos=\"67:1-67:36\"><strong>Deleting the Placeholder Website<\/strong><\/h2>\n<p data-sourcepos=\"69:1-69:50\">Remove the placeholder website created by Apache2:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\"><span class=\"hljs-built_in\">cd<\/span> \/var\/www\/html &amp;&amp; rm index.html\r\n<\/code><\/pre>\n<\/div>\n<h2 data-sourcepos=\"75:1-75:31\"><strong>Downloading WordPress Files<\/strong><\/h2>\n<p data-sourcepos=\"77:1-77:64\">Download the latest WordPress files using the following command:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\"><span class=\"hljs-built_in\">cd<\/span> \/home &amp;&amp; wget https:\/\/wordpress.org\/latest.zip\r\nunzip latest.zip\r\nrm latest.zip\r\ncp -R \/home\/wordpress\/* \/var\/www\/html\r\n<\/code><\/pre>\n<\/div>\n<h2 data-sourcepos=\"86:1-86:32\"><strong>Adjusting Folder Permissions<\/strong><\/h2>\n<p data-sourcepos=\"88:1-88:35\">Set the correct folder permissions:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\"><span class=\"citation-2\">chown -R www-data:www-data \/var\/www\/html\r\nsudo find \/var\/www\/html -<\/span><span class=\"hljs-built_in\"><span class=\"citation-2\">type<\/span><\/span><span class=\"citation-2\"> d -<\/span><span class=\"hljs-built_in\"><span class=\"citation-2\">exec<\/span><\/span><span class=\"citation-2\"> chmod 755 {} \\;\r\nsudo find \/var\/www\/html -<\/span><span class=\"hljs-built_in\"><span class=\"citation-2\">type<\/span><\/span><span class=\"citation-2\"> f -<\/span><span class=\"hljs-built_in\"><span class=\"citation-2\">exec<\/span><\/span><span class=\"citation-2 citation-end-2\"> chmod 644<\/span> {} \\;\r\n<\/code><\/pre>\n<\/div>\n<h2 data-sourcepos=\"96:1-96:30\"><strong>Setting up a Reverse-Proxy<\/strong><\/h2>\n<p data-sourcepos=\"98:1-98:42\">Create a reverse-proxy configuration file:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\">nano \/etc\/apache2\/sites-available\/wordpress.conf\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"104:1-104:42\">Paste the following content into the file:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">&lt;VirtualHost *:80&gt;\r\nServerAdmin &lt;YourEmail&gt;\r\nDocumentRoot \/var\/www\/html\/\r\nServerName &lt;Your(Sub)Domain&gt;\r\n&lt;<span class=\"citation-3 citation-end-3\">Directory \/var\/www\/html\/&gt;\r\nOptions +FollowSymlinks\r\nAllowOverride All\r\nRequire all granted\r\n&lt;IfModule mod_dav.c&gt;\r\nDav off\r\n&lt;\/IfModule&gt;\r\nSetEnv HOME \/var\/www\/html\r\nSetEnv HTTP_HOME \/var\/www\/html\r\n&lt;\/Directory&gt;\r\nErrorLog ${APACHE_LOG_DIR}\/error.log\r\nCustomLog ${APACHE_LOG_DIR}\/access.log combined<\/span>\r\n&lt;\/VirtualHost&gt;\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"126:1-126:105\">Replace <code>&lt;YourEmail&gt;<\/code> with your email address and <code>&lt;Your(Sub)Domain&gt;<\/code> with your actual (sub)domain.<\/p>\n<p data-sourcepos=\"128:1-128:63\">Save the file, activate the configuration, and restart Apache2:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\">CTRL+O, CTRL+X\r\na2ensite wordpress.conf\r\nsystemctl restart apache2\r\n<\/code><\/pre>\n<\/div>\n<h2 data-sourcepos=\"136:1-136:45\"><strong>Installing an SSL Certificate via Certbot<\/strong><\/h2>\n<p data-sourcepos=\"138:1-138:66\">Install Certbot and generate a free Let&#8217;s Encrypt SSL certificate:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container\" role=\"text\">apt install certbot python3-certbot-apache -y\r\ncertbot --apache\r\n<\/code><\/pre>\n<\/div>\n<h2 data-sourcepos=\"145:1-145:37\"><strong>Installing WordPress Completed<\/strong><\/h2>\n<p data-sourcepos=\"147:1-147:84\">Open your (sub)domain in the browser. The WordPress installation wizard will appear.<\/p>\n<p>Click &#8220;Let&#8217;s go!&#8221;.<br \/>\n<img decoding=\"async\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2022\/10\/1a.png\" alt=\"WP installation wizzard\" \/><\/p>\n<p>Enter the database connection details.<br \/>\n<img decoding=\"async\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2022\/10\/2a.png\" alt=\"WP Database credentials\" \/><\/p>\n<p>Click &#8220;Submit&#8221;.<\/p>\n<p>Click &#8220;Run the installation&#8221;.<br \/>\n<img decoding=\"async\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2022\/10\/3a.png\" alt=\"WP start the installation\" \/><\/p>\n<p>Enter site title and create admin account.<\/p>\n<p>Click &#8220;Install WordPress&#8221;.<br \/>\n<img decoding=\"async\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2022\/10\/4a.png\" alt=\"WP Create Website and Admin Account\" \/><\/p>\n<p>Login to the backend of the WordPress.Tip: To get to the login of your WordPress instance in the future, use the following URL scheme:<\/p>\n<pre class=\"wp-block-code\"><code>https:\/\/&lt;your(sub)domain\/wp-admin<\/code><\/pre>\n<p>The login screen will look like this:<br \/>\n<img decoding=\"async\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2022\/10\/6a.png\" alt=\"WP Login interface\" \/><\/p>\n<p>Go crazy!<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>The article provides detailed instructions on how to install WordPress on an existing server. The instructions are written in a clear and easy-to-follow manner, even for those who are not familiar with Linux.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>WordPress is a popular content management system (CMS) that allows users to create websites and blogs without extensive coding knowledge. This guide provides a step-by-step process for setting up a WordPress website on an existing Linux server. Prerequisites: A Linux-based server with root access A (sub)domain connected to the server (recommended) Installing PHP8.2 PHP is required for WordPress to function.&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"kbtopic":[1099],"kbtag":[1179],"class_list":["post-3756","kb","type-kb","status-publish","hentry","kbtopic-tutorials","kbtag-installing-wordpress"],"_links":{"self":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3756","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/comments?post=3756"}],"version-history":[{"count":6,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3756\/revisions"}],"predecessor-version":[{"id":6289,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3756\/revisions\/6289"}],"wp:attachment":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/media?parent=3756"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=3756"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtag?post=3756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}