Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Tutorials
    • All tutorials
        • Overview
        • Management console
        • Terraform
      • Transferring a WordPress website from a different hosting provider to Yandex Cloud
      • Setting up virtual hosting
      • Creating a Python web application with Flask
      • Hosting a static Gatsby website
      • Migrating to Cloud CDN from a third-party CDN provider
      • Getting website traffic statistics using S3 Select

In this article:

  • Prepare your cloud environment
  • Required paid resources
  • Create a VM for WordPress
  • Create a MySQL® DB cluster
  • Configure the Nginx web server
  • Install WordPress and additional components
  • Complete WordPress configuration
  • Configure DNS
  • Add a DNS zone
  • Add resource records
  • Delegate the domain name
  • Test the website
  • How to delete the resources you created
  1. Application solutions
  2. Creating a website
  3. WordPress website on a MySQL® database
  4. Management console

Creating a WordPress website with a MySQL® database cluster using the management console

Written by
Yandex Cloud
Updated at May 7, 2025
  • Prepare your cloud environment
    • Required paid resources
  • Create a VM for WordPress
  • Create a MySQL® DB cluster
  • Configure the Nginx web server
  • Install WordPress and additional components
  • Complete WordPress configuration
  • Configure DNS
    • Add a DNS zone
    • Add resource records
    • Delegate the domain name
  • Test the website
  • How to delete the resources you created

To create an infrastructure for a WordPress website with a MySQL® database cluster using the Yandex Cloud management console:

To set up a WordPress website with a MySQL® cluster:

  1. Prepare your cloud environment.
  2. Create a VM for WordPress.
  3. Create a MySQL® DB cluster.
  4. Configure Nginx web server.
  5. Install WordPress and additional components.
  6. Complete WordPress configuration.
  7. Configure DNS.
  8. Test the website.

If you no longer need the resources you created, delete them.

Prepare your cloud environmentPrepare your cloud environment

Sign up in Yandex Cloud and create a billing account:

  1. Navigate to the management console and log in to Yandex Cloud or register a new account.
  2. On the Yandex Cloud Billing page, make sure you have a billing account linked and it has the ACTIVE or TRIAL_ACTIVE status. If you do not have a billing account, create one and link a cloud to it.

If you have an active billing account, you can navigate to the cloud page to create or select a folder for your infrastructure to operate in.

Learn more about clouds and folders.

Required paid resourcesRequired paid resources

The cost of hosting your WordPress website with a MySQL® cluster includes:

  • Fee for a continuously running VM (see Yandex Compute Cloud pricing).
  • Fee for a MySQL® DB cluster (see Yandex Managed Service for MySQL® pricing).
  • Fee for a dynamic or static external IP address (see Yandex Virtual Private Cloud pricing).
  • Fee for public DNS queries and DNS zones (see Yandex Cloud DNS pricing).

Create a VM for WordPressCreate a VM for WordPress

To create a VM for WordPress:

Management console
  1. On the folder page in the management console, click Create resource and select Virtual machine instance.

  2. Under Boot disk image, select a public image: Debian 11, Ubuntu 20.04 LTS, or CentOS 7.

  3. Under Location, select an availability zone for your VM. If you do not know which availability zone you need, leave the default one.

  4. Under Computing resources, navigate to the Custom tab and specify the required platform, number of vCPUs, and the amount of RAM:

    • Platform: Intel Ice Lake
    • vCPU: 2
    • Guaranteed vCPU performance: 20%
    • RAM: 2 GB
  5. Under Network settings:

    • In the Subnet field, select the network and subnet to connect your VM to. If the required network or subnet is not listed, create it.
    • Under Public IP address, keep Auto to assign your VM a random external IP address from the Yandex Cloud pool or select a static address from the list if you reserved one in advance.
  6. Under Access, select SSH key and specify the VM access data:

    • In the Login field, enter a username, e.g., yc-user. Do not use root or other names reserved by the OS. To perform actions requiring root privileges, use the sudo command.
    • In the SSH key field, select the SSH key saved in your organization user profile.

      If there are no saved SSH keys in your profile, or you want to add a new key:

      • Click Add key.
      • Enter a name for the SSH key.
      • Upload or paste the contents of the public key file. You need to create a key pair for the SSH connection to a VM yourself.
      • Click Add.

      The SSH key will be added to your organization user profile.

      If users cannot add SSH keys to their profiles in the organization, the added public SSH key will only be saved to the user profile of the VM being created.

  7. Under General information, specify the VM name: wp-mysql-tutorial-web.

    Alert

    Once created, the VM gets an IP address and a host name (FQDN) for connections. If you selected No address in the Public IP address field, you will not be able to access the VM from the internet.

  8. Click Create VM.

It may take a few minutes to create the VM. When the VM status changes to RUNNING, proceed to the next step.

Once created, the VM is assigned a public IP address and a host name (FQDN). This data can be used for SSH access.

Create a MySQL® DB clusterCreate a MySQL® DB cluster

To create a MySQL® DB cluster:

Management console
  1. On the folder page in the management console, click Create resource and select MySQL cluster.

  2. In the Cluster name field, enter the name: wp-mysql-tutorial-db-cluster.

  3. Under Host class, select s3-c2-m8.

  4. Under Size of storage, specify: 10 GB.

  5. Under Database:

    • In the DB name field, enter wp-mysql-tutorial-db.
    • In the Username field, enter wordpress.
    • In the Password field, enter the password you will use to access the DB.
  6. Under Network settings, select the network your cluster will be connected to.

  7. Under Hosts, add two more hosts in the other availability zones. When creating hosts, do not enable Public access for them.

  8. Under DBMS settings, click Settings.

    In the default_authentication_plugin field, select mysql_native_password and click Save.

  9. Click Create cluster.

Creating a DB cluster may take a few minutes.

Configure the Nginx web serverConfigure the Nginx web server

After the wp-mysql-tutorial-web VM's status changes to RUNNING:

  1. Under Network on the VM page in the management console, find the VM's public IP address.

  2. Connect to the VM via SSH. You can use the ssh utility in Linux or macOS, or PuTTY in Windows.

    The recommended authentication method when connecting over SSH is using a key pair. Make sure to configure the generated key pair so that the private key matches the public key sent to the VM.

  3. Install Nginx, PHP-FPM process manager, and additional packages:

    Debian/Ubuntu
    CentOS
    sudo apt-get update
    sudo apt-get install -y nginx-full php-fpm php-mysql
    sudo systemctl enable nginx
    
    sudo yum -y install epel-release
    sudo yum -y install nginx
    sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
    sudo yum -y --enablerepo=remi-php74 install php php-mysql php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt
    sudo yum -y --enablerepo=remi-php74 install php-fpm
    sudo systemctl enable nginx
    sudo systemctl enable php-fpm
    
  4. Use the Nginx configuration files to configure the web server:

    Debian/Ubuntu
    CentOS
    1. You can edit files in the nano editor:

      sudo nano /etc/nginx/sites-available/wordpress
      
    2. Edit the file as follows:

      server {
          listen 80 default_server;
      
          root /var/www/wordpress;
          index index.php;
      
          server_name <DNS-server_name>;
      
          location / {
              try_files $uri $uri/ =404;
          }
      
          error_page 404 /404.html;
          error_page 500 502 503 504 /50x.html;
          location = /50x.html {
              root /usr/share/nginx/html;
          }
      
          location ~ \.php$ {
              try_files $uri =404;
              fastcgi_split_path_info ^(.+\.php)(/.+)$;
              fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
              fastcgi_index index.php;
              fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
              include fastcgi_params;
          }
      }
      
    3. Allow launching your site:

      sudo rm /etc/nginx/sites-enabled/default
      sudo ln -s /etc/nginx/sites-available/wordpress /etc/nginx/sites-enabled/
      

    You can edit the files nginx.conf and wordpress.conf in the nano editor:

    1. Open nginx.conf:

      sudo nano /etc/nginx/nginx.conf
      
    2. Edit the file as follows:

      user nginx;
      worker_processes auto;
      error_log /var/log/nginx/error.log;
      pid /run/nginx.pid;
      include /usr/share/nginx/modules/*.conf;
      
      events {
        worker_connections 1024;
      }
      
      http {
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"';
      
        access_log  /var/log/nginx/access.log main;
      
        sendfile            on;
        tcp_nopush          on;
        tcp_nodelay         on;
        keepalive_timeout   65;
        types_hash_max_size 2048;
      
        include             /etc/nginx/mime.types;
        default_type        application/octet-stream;
      
        include /etc/nginx/conf.d/*.conf;
      }
      
    3. Open wordpress.conf:

      sudo nano /etc/nginx/conf.d/wordpress.conf
      
    4. Edit the file as follows:

      server {
          listen 80 default_server;
      
          root /usr/share/nginx/wordpress/;
          index index.php;
      
          server_name <DNS-server_name>;
      
          location / {
              try_files $uri $uri/ =404;
          }
      
          error_page 404 /404.html;
          error_page 500 502 503 504 /50x.html;
          location = /50x.html {
              root /usr/share/nginx/html;
          }
      
          location ~ \.php$ {
              try_files $uri =404;
              fastcgi_split_path_info ^(.+\.php)(/.+)$;
              fastcgi_pass 127.0.0.1:9000;
              fastcgi_index index.php;
              fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
              include fastcgi_params;
          }
      }
      

Install WordPress and additional componentsInstall WordPress and additional components

  1. Download and unpack the latest WordPress version:

    Debian/Ubuntu
    CentOS
    wget https://wordpress.org/latest.tar.gz
    tar -xzf latest.tar.gz
    mv wordpress/wp-config-sample.php wordpress/wp-config.php
    sudo mv wordpress /var/www/wordpress
    sudo chown -R www-data:www-data /var/www/wordpress
    
    curl https://wordpress.org/latest.tar.gz --output latest.tar.gz
    tar -xzf latest.tar.gz
    mv wordpress/wp-config-sample.php wordpress/wp-config.php
    sudo mv wordpress /usr/share/nginx/wordpress
    sudo chown -R nginx:nginx /usr/share/nginx/wordpress/
    

    Change the SELinux settings:

    sudo semanage fcontext -a -t httpd_sys_content_t "/usr/share/nginx/wordpress(/.*)?"
    sudo semanage fcontext -a -t httpd_sys_rw_content_t "/usr/share/nginx/wordpress(/.*)?"
    sudo restorecon -R /usr/share/nginx/wordpress
    sudo setsebool -P httpd_can_network_connect 1
    
  2. Get WordPress security keys:

    curl --silent https://api.wordpress.org/secret-key/1.1/salt/
    

    Save the command output. You will need the keys in the next step.

  3. Add the security keys to the WordPress configuration file: wp-config.php. You can edit files in the nano editor:

    Debian/Ubuntu
    CentOS
    sudo nano /var/www/wordpress/wp-config.php
    
    sudo nano /usr/share/nginx/wordpress/wp-config.php
    

    Replace the configuration section for the values from the previous step:

    define('AUTH_KEY',         't vz,|............R lZ5]');
    define('SECURE_AUTH_KEY',  '@r&pPD............dK-A%=');
    define('LOGGED_IN_KEY',    '%6TuLl............9>/dNE');
    define('NONCE_KEY',        'DO(u.H............$?ja-e');
    define('AUTH_SALT',        '|G Vo<............Xeb.~y');
    define('SECURE_AUTH_SALT', 'Y5tIYA............7Lxf8J');
    define('LOGGED_IN_SALT',   'gR]>WZ............<>|;YY');
    define('NONCE_SALT',       '=]nQIb............HLT2:9');
    
  4. Go to the connection configuration section for the wp-mysql-tutorial-db-cluster cluster:

    // ** MySQL® settings - You can get this info from your web host. ** //
    /** The name of the database for WordPress. */
    
    define( 'DB_NAME', '<DB_NAME>' );
    /** MySQL® database username. */
    define( 'DB_USER', '<DB_USER>' );
    
    /** MySQL® database password. */
    define( 'DB_PASSWORD', '<DB_PASSWORD>' );
    
    /** MySQL® hostname. */
    define( 'DB_HOST', '<DB_HOST>' );
    

    Replace the placeholders in the file:

    • <DB_NAME>: wp-mysql-tutorial-db DB name.

    • <DB_USER>: wordpress user name.

    • <DB_PASSWORD>: Password you set when creating the database cluster.

    • <DB_HOST>: MySQL® host name in XXXX-XXXXXXXXXX.mdb.yandexcloud.net format.

      To find out the FQDN of your MySQL® host:

      Management console
      CLI
      1. Go to the MySQL® cluster page in the management console.
      2. On the Databases tab next to the DB, click → Connect.
      3. Find the mysql --host=ХХХХ-ХХХХХХХХХХ.mdb.yandexcloud.net line, where ХХХХ-ХХХХХХХХХХ.mdb.yandexcloud.net is the FQDN of the host with the MASTER role.

      Get a host list and copy the MASTER host's NAME:

      yc managed-mysql host list --cluster-name <MySQL®>_cluster_name
      
      +------------------------+----------------------+---------+--------+-------------------+-----------+
      |           NAME         |      CLUSTER ID      |  ROLE   | HEALTH |      ZONE ID      | PUBLIC IP |
      +------------------------+----------------------+---------+--------+-------------------+-----------+
      | rc1a-...mdb.yandexcloud.net | c9quhb1l32unm1sdn0in | MASTER  | ALIVE  | ru-central1-a | false     |
      | rc1b-...mdb.yandexcloud.net | c9quhb1l32unm1sdn0in | REPLICA | ALIVE  | ru-central1-b | false     |
      +------------------------+----------------------+---------+--------+-------------------+-----------+
      
  5. Restart Nginx and PHP-FPM:

    Debian/Ubuntu
    CentOS
    sudo systemctl restart nginx.service
    sudo systemctl restart php7.4-fpm.service
    
    sudo systemctl restart nginx.service
    sudo systemctl restart php-fpm.service
    

Complete WordPress configurationComplete WordPress configuration

  1. Under Network on the VM page in the management console, find the VM's public IP address.
  2. Open the VM by entering its address in your browser.
  3. Select the language and click Continue.
  4. Fill out information to access the website:
    • Enter any website name, for example, wp-your-project.
    • Specify the username to be used to log in to the admin panel (for example, admin).
    • Enter the password to be used to log in to the admin panel.
    • Enter your email address.
  5. Click Install WordPress.
  6. If the installation is successful, click Log in.
  7. Log in to the website with the username and password specified in the previous steps. This will open the admin panel where you can start working with your website.

Configure DNSConfigure DNS

If you have a registered domain name, use the Cloud DNS service to manage the domain.

The tutorial below describes configuring DNS for the example.com domain name.

Add a DNS zoneAdd a DNS zone

Management console

To add a public DNS zone:

  1. Open the Cloud DNS section of the folder where you need to create a DNS zone.
  2. Click Create zone.
  3. Specify the DNS zone settings:
    • Zone: example.com.. You can provide you registered domain instead.
    • Type: Public.
    • Name: example-zone-1.
  4. Click Create.

Add resource recordsAdd resource records

Create DNS records in the public zone:

Management console
  1. Under Network on the VM page in the management console, find the VM's public IP address.
  2. Create an A record:
    • Open the Cloud DNS section of the folder containing the example.com DNS zone.
    • Select the example.com DNS zone from the list.
    • Click Create record.
    • Set the record parameters:
      • Name: Leave empty.
      • Type: Keep А as the value.
      • Data: Enter your VM's public address.
      • TTL (in seconds) (record time to live): Keep the default value.
    • Click Create.
  3. Create a CNAME record:
    • Select the example.com DNS zone from the list.
    • Click Create record.
    • Set the record parameters:
      • Name: www.
      • Type: Keep CNAME as the value.
      • Data: Enter example.com.
      • TTL (in seconds) (record time to live): Keep the default value.
    • Click Create.

Delegate the domain nameDelegate the domain name

Delegation is the transfer of authority from the registrar's servers to yours. For a domain, NS resource records are created (ns1.yandexcloud.net and ns2.yandexcloud.net).

To delegate a domain, specify its DNS servers in the registrar's account.

Delegation does not take effect immediately. It usually takes up to 24 hours (86,400 seconds) for internet service providers to update records. This depends on the TTL value which specifies how long domain records are cached.

You can check domain delegation using Whois or the dig utility:

dig +short NS example.com

Result:

ns2.yandexcloud.net.
ns1.yandexcloud.net.

Test the websiteTest the website

To test the site, enter its IP address or domain name in your browser:

  • http://<public_IP_of_VM>
  • http://www.example.com

To access the WordPress control panel, use http://www.example.com/wp-admin/.

How to delete the resources you createdHow to delete the resources you created

To stop paying for the resources you created:

  1. Delete the DNS zone.
  2. Delete the MySQL® cluster.
  3. Delete the VM.

If you reserved a static public IP address for the VM, delete it.

See alsoSee also

  • Creating a WordPress website with a MySQL® database cluster using Terraform.

Was the article helpful?

Previous
Overview
Next
Terraform
Yandex project
© 2025 Yandex.Cloud LLC