Creating a website on CMS Joomla with a PostgreSQL database using the management console
To create an infrastructure for your Joomla CMS website with a PostgreSQL database using the Yandex Cloud management console:
- Get your cloud ready.
- Create and set up a cloud network.
- Create a VM for Joomla.
- Create and configure a public DNS zone.
- Add a TLS certificate to Yandex Certificate Manager.
- Create a PostgreSQL DB cluster.
- Set up your VM environment.
- Configure Joomla.
- Test the website.
If you no longer need the resources you created, delete them.
Get your cloud ready
Sign up for Yandex Cloud and create a billing account:
- Navigate to the management console- On the Yandex Cloud BillingACTIVEorTRIAL_ACTIVEstatus. 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
Learn more about clouds and folders here.
Required paid resources
The cost of hosting a Joomla-powered website includes:
- Fee for a continuously running VM (see Yandex Compute Cloud pricing).
- Fee for using a public IP address (see Yandex Virtual Private Cloud pricing).
- Fee for a PostgreSQL DB cluster (see Yandex Managed Service for PostgreSQL pricing).
- Fee for outbound traffic from Yandex Cloud to the internet (see Yandex Compute Cloud pricing).
- Fee for public DNS queries and DNS zones (see Yandex Cloud DNS pricing).
Set up a cloud network
Create a cloud network and subnets
- 
Create a cloud network: - In the management console- In the list of services, select Virtual Private Cloud.
- At the top right, click Create network.
- In the Name field, specify joomla-network.
- In the Advanced field, disable the Create subnets option.
- Click Create network.
 
- In the management console
- 
Create a subnet in the ru-central1-bavailability zone:- In the network list window that opens, select joomla-networkyou have just created.
- In the top panel, click - In the Name field, specify joomla-subnet-b.
- In the Availability zone field, select the ru-central1-bavailability zone.
- In the CIDR field, specify 192.168.1.0/24.
- Click Create subnet.
 
- In the network list window that opens, select 
- 
Similarly, create subnets named joomla-subnet-aandjoomla-subnet-din theru-central1-aandru-central1-davailability zones, respectively. Specify192.168.2.0/24and192.168.3.0/24in the CIDR field for these subnets.
Create security groups
Create joomla-sg and postgresql-sg security groups to manage network access permissions for the VM and the Yandex Managed Service for PostgreSQL cluster.
- 
Create a security group named joomla-sgfor your VM:- 
In the management console - 
In the list of services, select Virtual Private Cloud. 
- 
In the left-hand panel, select - 
In the Name field, enter joomla-sg.
- 
In the Network field, select joomla-network, which you created earlier.
- 
Under Rules, create the following traffic management rules: Traffic 
 directionDescription Port range Protocol Source / 
 Destination nameCIDR blocks / 
 Security groupInbound http80TCPCIDR0.0.0.0/0Inbound https443TCPCIDR0.0.0.0/0Inbound ssh22TCPCIDR0.0.0.0/0Inbound selfAllAnySecurity groupCurrentOutbound anyAllAnyCIDR0.0.0.0/0
- 
Click Create. 
 
- 
- 
Similarly, create a security group named postgresql-sgfor the Managed Service for PostgreSQL cluster with the following traffic rules:Traffic 
 directionDescription Port range Protocol Source / 
 Destination nameCIDR blocks / 
 Security groupInbound port-64326432TCPCIDR192.168.1.0/24Inbound selfAllTCPSecurity groupCurrentOutbound anyAllAnyCIDR0.0.0.0/0
Reserve a static public IP address
Reserve a static public IP address for the VM that will host your website.
- In the management console- In the list of services, select Virtual Private Cloud.
- In the left-hand panel, select - In the window that opens, select ru-central1-bin the Availability zone field and click ** Reserve**.
Create a VM for Joomla
- 
In the management console Virtual machine instance.
- 
Under Boot disk image, in the Product search field, type Ubuntu 24.04and select a public Ubuntu 24.04 LTS image.
- 
Under Location, select the ru-central1-bavailability zone.
- 
Under Network settings: - In the Subnet field, select joomla-networkandjoomla-subnet-b.
- In the Public IP address field, select Listand then, the previously reserved IP address in the field that appears.
- In the Security groups field, select the joomla-sgsecurity group you created earlier.
 
- In the Subnet field, select 
- 
Under Access, select SSH key and specify the VM access credentials: - In the Login field, specify the username: yc-user.
- 
In the SSH key field, select the SSH key saved in your organization user profile. If there are no SSH keys in your profile or you want to add a new key: - 
Click Add key. 
- 
Enter a name for the SSH key. 
- 
Select one of the following: - 
Enter manually: Paste the contents of the public SSH key. You need to create an SSH key pair on your own.
- 
Load from file: Upload the public part of the SSH key. You need to create an SSH key pair on your own.
- 
Generate key: Automatically create an SSH key pair.When adding a new SSH key, an archive containing the key pair will be created and downloaded. In Linux or macOS-based operating systems, unpack the archive to the /home/<user_name>/.sshdirectory. In Windows, unpack the archive to theC:\Users\<user_name>/.sshdirectory. You do not need additionally enter the public key in the management console.
 
- 
- 
Click Add. 
 The system will add the SSH key to your organization user profile. If the organization has disabled the ability for users to add SSH keys to their profiles, the added public SSH key will only be saved in the user profile inside the newly created resource. 
- 
 
- In the Login field, specify the username: 
- 
Under General information, specify the VM name: joomla-web-server.
- 
Click Create VM. 
It may take a few minutes to create your VM.
Create and configure a public DNS zone
You need to link the domain name you want to use for your website to the IP address of the new joomla-web-server VM. You can use Yandex Cloud DNS to manage the domain.
Delegate the domain name
Delegation involves reassigning domain management from your registrar's servers to your own ones, which includes creating NS records.
To delegate a domain, specify the ns1.yandexcloud.net and ns2.yandexcloud.net DNS server addresses in the domain settings in your account on your domain registrar's website.
Delegation does not take effect immediately. Internet provider servers normally update records within 24 hours (86,400 seconds). This depends on the TTL value which specifies how long domain records are cached.
You can check domain delegation using Whoisdig utility:
dig +short NS example.com
Result:
ns2.yandexcloud.net.
ns1.yandexcloud.net.
Create a public DNS zone
- 
In the management console - 
From the list of services, select Cloud DNS and click Create zone. 
- 
Specify the zone settings consistent with your domain: - Zone: Domain zone. Its name must end with a trailing dot. For example, example.com.matches theexample.comdomain. To create a domain name with non-Latin characters, use the Punycode- Type: Public.
- Name: joomla-zone.
 
- Zone: Domain zone. Its name must end with a trailing dot. For example, 
- 
Click Create. 
Create a type A resource record
In your DNS zone, create a type A resource record pointing to the public IP address of the previously created VM:
- 
In the management console - 
Select Cloud DNS. 
- 
Select joomla-zoneyou previously created and click Create record.
- 
Specify the record settings: - 
In the Name field, select Matches zone name (@).
- 
In the Type field, select the Arecord type.
- 
In the Data field, specify the public IP address of the web server VM you created earlier. You can find the VM IP address in the management console 
 
- 
- 
Click Create. 
Add a TLS certificate to Yandex Certificate Manager
Create a new Let's Encrypt® certificate for your domain to enable secure access to your website over TLS:
- 
Add the new certificate to Certificate Manager: Management console- In the management console- In the list of services, select Certificate Manager.
- Click Add certificate and select Let's Encrypt certificate.
- In the window that opens, specify joomla-certin the Name field.
- In the Domains field, specify your domain name, e.g., example.com.
- Select DNSas the domain ownership verification type.
- Click Create.
 
- In the management console
- 
To successfully issue the certificate, pass a domain rights check: Management console- In the management console- In the list of services, select Certificate Manager.
- From the list of certificates, select joomla-cert.
- In the window that opens, under Check rights for domains, select CNAME record.
- In the section below, click Create record and then, Create in the window that opens.
 The domain rights check may take from a few minutes to a few days. Wait until it is complete. As a result, the certificate will be issued and get the Issuedstatus.
- In the management console
Create a PostgreSQL DB cluster
- In the management consolePostgreSQL cluster.
- In the Cluster name field, enter the cluster name: joomla-pg-cluster.
- In the Version field, select the DBMS version: 17.
- Under Host class, select the appropriate host class.
- Under Storage size, specify: 10 GB.
- Under Database, specify:
- DB name: joomla_db.
- Username: joomla.
- In the Password field, select Enter manuallyand set a password you will use to access the database.
 
- DB name: 
- Under Network settings, select joomla-networkandpostgresql-sgyou created previously as the network and security group, respectively.
- Under Hosts, add additional hosts to ensure one host per availability zone. When creating hosts, do not enable Public access for them.
- Click Create cluster.
Creating a DB cluster may take a few minutes.
Set up your VM environment
At this step, you will prepare the VM environment to deploy and set up Joomla.
- 
Export the joomla-certTLS certificate to your local computer:Management console- In the management console- In the list of services, select Certificate Manager and choose joomla-cert.
- In the top panel, click Certificate without private key, and click Download certificate. A file with thecertificate.pemcertificate will be saved to your computer.
- Repeat the previous step and download the private key by selecting Private key only. Rename the downloaded private key file toprivate_key.pem.
- Save the downloaded certificate.pemandprivate_key.pemfiles: you will need them to configure the web server.
 
- In the management console
- 
Copy the certificate and private key to the VM: scp ./certificate.pem yc-user@<VM_IP_address>:certificate.pem \ && scp ./private_key.pem yc-user@<VM_IP_address>:private_key.pemWhere <VM_IP_address>is the public IP address of the previously createdjoomla-web-serverVM.You can find the VM IP address in the management console If this is your first time connecting to the VM, you will get this unknown host warning: The authenticity of host '51.250.**.*** (51.250.**.***)' can't be established. ED25519 key fingerprint is SHA256:PpcKdcT09gjU045pkEIwIU8lAXXLpwJ6bKC********. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])?Type yesinto the terminal and press Enter.
- 
Connect to the VM over SSH: ssh yc-user@<VM_IP_address>
- 
Create a directory for the certificate and move the copied files there: sudo mkdir /etc/ssl-certificates sudo mv certificate.pem /etc/ssl-certificates/ sudo mv private_key.pem /etc/ssl-certificates/
- 
Upgrade the versions of the packages installed on the VM: sudo apt update && sudo apt upgrade -y
- 
Install and run the Apache HTTP server sudo apt install apache2 sudo systemctl start apache2 && sudo systemctl enable apache2
- 
Install PHP sudo apt install php libapache2-mod-php php-common php-pgsql php-xml php-mbstring php-curl php-zip php-intl php-json unzip
- 
Download and unpack the Joomla package: Note This example uses a link to Joomla 5.2.4, the latest version at the time of writing this guide. To check for a newer version and get the download link, visit the project websitewget https://downloads.joomla.org/cms/joomla5/5-2-4/Joomla_5-2-4-Stable-Full_Package.zip -O Joomla.zip sudo rm /var/www/html/index.html sudo unzip Joomla.zip -d /var/www/html rm Joomla.zip
- 
Set up access permissions for the website directory: sudo chown -R www-data:www-data /var/www/html sudo chmod -R 755 /var/www/html
- 
Change the number of the default port used by Joomla to access PostgreSQL databases: Yandex Managed Service for PostgreSQL uses port 6432.- 
Open the Joomla database access driver configuration file: sudo nano /var/www/html/libraries/vendor/joomla/database/src/Pdo/PdoDriver.php
- 
In the file, find the section with PostgreSQL database settings and change the port number from 5432to6432:... case 'pgsql': $this->options['port'] = $this->options['port'] ?? 6432; ...Make sure to save your changes. 
 
- 
- 
Configure a virtual host for your website: - 
Create a virtual host configuration file: sudo nano /etc/apache2/sites-available/joomla.conf
- 
Add the following configuration into the file: <VirtualHost *:80> ServerAdmin admin@localhost DocumentRoot /var/www/html ServerName <domain_name> <Directory /var/www/html> Options FollowSymLinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/joomla_http_error.log CustomLog ${APACHE_LOG_DIR}/joomla_http_access.log combined </VirtualHost> <VirtualHost *:443> ServerAdmin admin@localhost DocumentRoot /var/www/html ServerName <domain_name> ErrorLog ${APACHE_LOG_DIR}/joomla_ssl_error.log CustomLog ${APACHE_LOG_DIR}/joomla_ssl_access.log combined SSLEngine on SSLCertificateFile /etc/ssl-certificates/certificate.pem SSLCertificateChainFile /etc/ssl-certificates/certificate.pem SSLCertificateKeyFile /etc/ssl-certificates/private_key.pem </VirtualHost>Where <domain_name>is the domain name of your website, e.g.,example.com.
 
- 
- 
Activate the virtual host and restart the web server: sudo a2ensite joomla.conf sudo a2enmod rewrite sudo a2enmod ssl sudo systemctl restart apache2
Configure Joomla
- 
Get the Managed Service for PostgreSQL cluster host names (you will need them when installing Joomla): Management console- In the management console- Select the joomla-pg-clustercluster and open the Hosts tab.
- Hover over the Host FQDN field in the row with each host and click 
 
- In the management console
- 
Install and configure Joomla: - 
Open the Joomla setup wizard in your browser. At this step, you can access it using any of these addresses: - http://<VM_public_IP_address>
- http://<your_domain_name>
- https://<your_domain_name>
 
- 
When configuring database parameters, fill in the following fields: - 
Database type: PostgreSQL (PDO).
- 
Host name: <host_1_name>,<host_2_name>,<host_3_name>Where <host_1_name>,<host_2_name>, and<host_3_name>are the Managed Service for PostgreSQL cluster host FQDNs you copied at the previous step.
- 
Database username: joomla.
- 
Database user password: DB user password set when creating the PostgreSQL cluster. 
- 
Database name: joomla_db.
- 
Connection encryption: Keep the default value. 
 
- 
- 
Joomla may prompt you to create or delete a specific test file in the product installation directory on the VM for security purposes. Navigate to the /var/www/html/installation/directory and create or delete the specified file there:You are trying to connect to a database host that is not available on your local server. You need to verify ownership of the hosting account. Read the information provided on the **Secure installation procedure** page. To verify your ownership of the website, delete `_JoomlazUZKusLnD2jXi********.txt` from the `installation` directory and click **Install Joomla** to continue.
 
- 
- 
After installation is complete, delete the installationdirectory from the VM. This is a Joomla security requirement:sudo rm -rf /var/www/html/installation
If you encounter any issues while installing Joomla, use this guide
Test the website
After Joomla installation is complete, enter your website’s IP address or domain name in the browser to test the site:
- http://<VM_public_IP_address>
- http://example.com
- https://example.com
Now you can further configure your website and add content using the Joomla admin interface and tools.
How to delete the resources you created
To stop paying for the resources you created:
- Delete the joomla-web-serverVM.
- Delete the static public IP address.
- Delete the Managed Service for PostgreSQL cluster named joomla-pg-cluster.
- Delete the DNS records and then delete the joomla-zoneDNS zone.
- Delete the joomla-certTLS certificate.
- Delete the joomla-sgandpostgresql-sgsecurity groups.
- Delete the joomla-subnet-a,joomla-subnet-b, andjoomla-subnet-dsubnets.
- Delete the joomla-networkcloud network.