Install WordPress on VPS: How to proceed

Ralph Buchner

Looking for a guide on how to install WordPress on a virtual private server? Then you have found the easiest and fastest at Dogado. We explain all the steps from A to Z.

display

Enlarge

Install WordPress on VPS: How to proceed

© Florian Krumm / Unsplash

WordPress is one of the most popular content management systems (CMS). This software was originally developed for blogs. In the meantime, however, it is also used for countless other pages. This allows you to add content quickly and easily. The backend is designed intuitively, so that no long training is necessary. Also, this is open source software that you can use completely free of charge. The huge popularity of WordPress also led to the emergence of many plugins. Therefore, a suitable extension is available for almost every application. There are also thousands of free themes that offer you countless design options.

VPS WordPress: preparatory measures for the installation

In this guide we will explain how to install WordPress on Linux – more specifically on a Debian 10 64-bit system. In order for you to be able to carry out the individual steps, it is important that you use this operating system for your VPS server. However, the installation is similar on other Linux distributions. In addition, we will install WordPress via Docker. It is therefore necessary that you already have this software installed. Finally, we will use Traefik for WordPress VPS installation. This reverse proxy allows multiple services to be offered on the vServer. With all these systems in place, you can install WordPress on the VPS.

To all VPS products at Dogado

Install WordPress via Docker

To install WordPress via Docker, you must first open the console. Then enter the following command:

mkdir -p /opt/containers/wordpress/{database,app}

This command specifies the required folder structure. The next step is to create a yml file in the wordpress directory you just created. This contains all the specifications for installing the new system. To do this, we will open the Nano text editor and use it to create the necessary file. To do this, we enter this command via the console:

nano /opt/containers/wordpress/docker-compose.yml 

You have to fill this file with content in the following step. You can use the following template for this:

versions: ‘3.1’

service:

wordpress:

image: wordpress

restart: unless stopped

environment:

WORDPRESS_DB_HOST: wordpress-db

WORDPRESS_DB_USER: exampleuser

WORDPRESS_DB_PASSWORD: examplepass

WORDPRESS_DB_NAME: wordpress

volumes:

– /opt/containers/wordpress/app:/var/www/html

labels:

– “traefik.enable=true”

– “traefik.http.routers.wordpress-app.entrypoints=http”

– “traefik.http.routers.wordpress-app.rule=Host(`wordpress.euredomain.de`)”

– “traefik.http.middlewares.wordpress-app-https-redirect.redirectscheme.scheme=https”

– “traefik.http.routers.wordpress-app.middlewares=wordpress-app-https-redirect”

– “traefik.http.routers.wordpress-app-secure.entrypoints=https”

– “traefik.http.routers.wordpress-app-secure.rule=Host(`wordpress.euredomain.de`)”

– “traefik.http.routers.wordpress-app-secure.tls=true”

– “traefik.http.routers.wordpress-app-secure.tls.certresolver=http”

– “traefik.http.routers.wordpress-app-secure.service=wordpress-app”

– “traefik.http.services.wordpress-app.loadbalancer.server.port=80”

– “traefik.docker.network=proxy”

– “traefik.http.routers.wordpress-app-secure.middlewares=secHeaders@file”

networks:

– proxy

– default

wordpress-db:

image:mysql:5.7

restart: unless stopped

environment:

MYSQL_DATABASE: wordpress

MYSQL_USER: exampleuser

MYSQL_PASSWORD: examplepass

MYSQL_RANDOM_ROOT_PASSWORD: ‘1’

volumes:

– /opt/containers/wordpress/database:/var/lib/mysql

networks:

– default

networks:

proxies:

external: true

The easiest way is to just copy and paste this content into the text editor. However, you still have to make some individual adjustments.

Find the following two lines in the file:

– “traefik.http.routers.wordpress-app.rule=Host(`wordpress.euredomain.de`)”

– “traefik.http.routers.wordpress-app-secure.rule=Host(`wordpress.euredomain.de`)”

Here you need to replace the domain given in the brackets in quotation marks with your own domain. After that you need to look for these four lines:

MYSQL_USER: exampleuser

MYSQL_PASSWORD: examplepass

WORDPRESS_DB_USER: exampleuser

WORDPRESS_DB_PASSWORD: examplepass

These specify the username and password for the MySQL database and for WordPress. Replace the expression “exampleuser” with the username you want to replace and the expression “examplepass” with two different passwords that are as secure as possible. After that, all you have to do is save the file.

Now it remains to run the installation process using the specifications in the file you just created. To do this, you have to open the console again. Enter the following command here:

docker-compose -f /opt/containers/wordpress/docker-compose.yml up -d 

This will run the installation process automatically. Once it finishes, you can start WordPress. In this VPS tutorial you will find instructions that, in addition to the installation of WordPress, also contain the initial configuration of the system.

Install WordPress on VPS: a smart choice

This guide shows that installing WordPress on Linux is quite simple. The tutorial is suitable for using a Virtual Private Server (VPS). Therefore, it makes sense to briefly go into what distinguishes this offer and what advantages it offers.

To make a page available online, you need a server. If you use a complete server for this, it is called the root server. However, this is not necessary for small and medium-sized websites and would only cause unnecessarily high costs. Therefore, many providers offer so-called web space. This is storage space on a server that you can use for your pages. Since you only use a small part of the server, this offer is much cheaper. However, you do not have full control over the settings and configurations.

VPS – also known as vServer – represents a compromise between these two solutions. This is a virtual system that only occupies a portion of the server and is therefore quite inexpensive. Nevertheless, you are completely independent. You have the option of specifying the server settings for your WordPress site exactly according to your requirements.

Install WordPress on VPS: How to proceed

Enlarge

Install WordPress on VPS: How to proceed

© Ian Battaglia / Unsplash

VPS at dogado: inexpensive and secure

At dogado you will discover a wide range of offers for the vServer. In this way you can book the computing power and storage space that you need for your website. You can also set up the VPS with different operating systems. With all dogado offers, you benefit from a high level of security and optimal data protection. All information is available from a provider in Germany. In addition, dogado is ISO certified (ISO 27001). This way, building your own WordPress site is super easy. Various tutorials support you in the implementation.

To all VPS products at Dogado