Creating a Joomla website with a PostgreSQL database using the management console
To create an infrastructure for your Joomla 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:
- Go to the management console
and log in to Yandex Cloud or create an account if you do not have one yet. - On the Yandex Cloud Billing
page, make sure you have a billing account linked and it has theACTIVE
orTRIAL_ACTIVE
status. If you do not have a billing account, create one.
If you have an active billing account, you can go to the cloud page
Learn more about clouds and folders.
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
, select the folder to create your infrastructure in. - From 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-b
availability zone:- In the network list window that opens, select
joomla-network
you have just created. - In the top panel, click
Create subnet. - In the Name field, specify
joomla-subnet-b
. - In the Zone field, select the
ru-central1-b
availability 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-a
andjoomla-subnet-d
in theru-central1-a
andru-central1-d
availability zones, respectively. Specify192.168.2.0/24
and192.168.3.0/24
in 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-sg
for your VM:-
In the management console
, select the folder to create your infrastructure in. -
From the list of services, select Virtual Private Cloud.
-
In the left-hand panel, select
Security groups and click Create security group. -
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 http
80
TCP
CIDR
0.0.0.0/0
Inbound https
443
TCP
CIDR
0.0.0.0/0
Inbound ssh
22
TCP
CIDR
0.0.0.0/0
Inbound self
All
Any
Security group
Current
Outbound any
All
Any
CIDR
0.0.0.0/0
-
Click Create.
-
-
Similarly, create a security group named
postgresql-sg
for the Managed Service for PostgreSQL cluster with the following traffic rules:Traffic
directionDescription Port range Protocol Source /
Destination nameCIDR blocks /
Security groupInbound port-6432
6432
TCP
CIDR
192.168.1.0/24
Inbound self
All
TCP
Security group
Current
Outbound any
All
Any
CIDR
0.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
, select the folder to create your infrastructure in. - From the list of services, select Virtual Private Cloud.
- In the left-hand panel, select
IP addresses and click Reserve address. - In the window that opens, select
ru-central1-b
in the Availability zone field and click ** Reserve**.
Create a VM for Joomla
-
In the management console
, on the dashboard of the folder where you want to create your infrastructure, click Create resource and selectVirtual machine instance
. -
Under Boot disk image, in the Product search field, type
Ubuntu 24.04
and select a public Ubuntu 24.04 LTS image. -
Under Location, select the
ru-central1-b
availability zone. -
Under Network settings:
- In the Subnet field, select
joomla-network
andjoomla-subnet-b
. - In the Public IP address field, select
List
and then, the previously reserved IP address in the field that appears. - In the Security groups field, select the
joomla-sg
security 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 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.
- 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. 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 the 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
, select the folder to create your infrastructure in. -
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, e.g.,
example.com.
for theexample.com
domain. To create a domain name with non-Latin characters, use the Punycode encoding. - Type:
Public
. - Name:
joomla-zone
.
- Zone: Domain zone. Its name must end with a trailing dot, e.g.,
-
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 the folder to create your infrastructure in. -
Select Cloud DNS.
-
Select
joomla-zone
you previously created and click Create record. -
Specify the record parameters:
-
In the Name field, select
Matches zone name (@)
. -
In the Type field, select the
A
record type. -
In the Data field, specify the public IP address of the previously created VM with a web server.
You can find the VM IP address in the management console
, on the VM page under Network.
-
-
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
, select the folder to create your infrastructure in. - From the list of services, select Certificate Manager.
- Click Add certificate and select
Let's Encrypt certificate
. - In the window that opens, specify
joomla-cert
in the Name field. - In the Domains field, specify your domain name, e.g.,
example.com
. - Select
DNS
as the domain rights check type. - Click Create.
- In the management console
-
To successfully issue the certificate, pass the domain rights check:
Management console- In the management console
, select the folder to create your infrastructure in. - From the list of services, select Certificate Manager.
- In 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 the result, the certificate will be issued and get the
Issued
status. - In the management console
Create a PostgreSQL DB cluster
- In the management console
, on the dashboard of the folder where you want to create your infrastructure, click Create resource and selectPostgreSQL 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 Size of storage, specify:
10 GB
. - Under Database, specify:
- DB name:
joomla_db
- Username:
joomla
- In the Password field, select
Enter manually
and set a password you will use to access the database.
- DB name:
- Under Network settings, select
joomla-network
andpostgresql-sg
you 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-cert
TLS certificate to your local computer:Management console- In the management console
, select the folder to create your infrastructure in. - In the list of services, select Certificate Manager and choose
joomla-cert
. - In the top panel, click
Export certificate, selectCertificate without private key
, and click Download certificate. A file with thecertificate.pem
certificate 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.pem
andprivate_key.pem
files: 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.pem
Where
<VM_IP_address>
is the public IP address of the previously createdjoomla-web-server
VM.You can find the VM IP address in the management console
on the VM page under Network.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
yes
into 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
with the required libraries: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 website .wget 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
5432
to6432
:... 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 folder with the cluster. From the list of services, select Managed Service for PostgreSQL. - Select the
joomla-pg-cluster
cluster and open the Hosts tab. - Hover over the Host FQDN field in the row with each host and click
to copy the host FQDN. Save the values you copied, as you will need them later.
- 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
installation
directory 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-server
VM. - 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-zone
DNS zone. - Delete the
joomla-cert
TLS certificate. - Delete the
joomla-sg
andpostgresql-sg
security groups. - Delete the
joomla-subnet-a
,joomla-subnet-b
, andjoomla-subnet-d
subnets. - Delete the
joomla-network
cloud network.