Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Tutorials
    • All tutorials
      • Static website in Object Storage with access via Cloud CDN
        • 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 with S3 Select

In this article:

  • Get your cloud ready
  • Required paid resources
  • Create a cloud network and subnets
  • Create a security group
  • Create a VM with a pre-installed web server
  • Upload the website files
  • Configure DNS
  • Delegate the domain name
  • Test the website
  • How to delete the resources you created
  1. Application solutions
  2. Creating a website
  3. Website based on LAMP or LEMP stack
  4. Management console

Website on a LAMP or LEMP stack using the management console

Written by
Yandex Cloud
Improved by
Danila N.
Updated at August 14, 2025
  • Get your cloud ready
    • Required paid resources
  • Create a cloud network and subnets
  • Create a security group
  • Create a VM with a pre-installed web server
  • Upload the website files
  • Configure DNS
    • Delegate the domain name
  • Test the website
  • How to delete the resources you created

To create an infrastructure for a website on a LAMP or LEMP stack using the Yandex Cloud management console:

  1. Get your cloud ready.
  2. Create a cloud network and subnets.
  3. Create a security group.
  4. Create a VM with a pre-installed web server.
  5. Upload the website files.
  6. Configure DNS.
  7. Test the website.

We will use the example.com domain name as an example.

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

Get your cloud readyGet your cloud ready

Sign up for Yandex Cloud and create a billing account:

  1. Navigate to the management console and log in to Yandex Cloud or create 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.

Learn more about clouds and folders here.

Required paid resourcesRequired paid resources

The infrastructure support costs for a website include:

  • 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 public DNS queries and DNS zones if using Yandex Cloud DNS (see Cloud DNS pricing).

Create a cloud network and subnetsCreate a cloud network and subnets

All resources created in this tutorial will belong to the same cloud network.

To create a network and subnets:

Management console
  1. In the management console, select Virtual Private Cloud.
  2. Click Create network.
  3. Enter web-network for the network Name.
  4. In the Advanced field, select Create subnets.
  5. Click Create network.

Create a security groupCreate a security group

Security groups contain rules that allow accessing your VMs from the internet. You need to create a security group named sg-web.

To create a security group:

Management console
  1. In the management console, select Virtual Private Cloud.
  2. Open the Security groups tab.
  3. Create a security group for your VM:
    1. Click Create group.

    2. Enter the group Name: sg-web.

    3. Select web-network for Network.

    4. Under Rules, create the following rules using the instructions below the table:

      Traffic
      direction
      Description Port range Protocol Source /
      destination
      CIDR blocks
      Outgoing any All Any CIDR 0.0.0.0/0
      Inbound ext-http 80 TCP CIDR 0.0.0.0/0
      Inbound ext-https 443 TCP CIDR 0.0.0.0/0
      1. Select the Egress or Ingress tab.
      2. Click Add rule.
      3. In the Port range field of the window that opens, specify a port or range of ports open for inbound or outbound traffic.
      4. In the Protocol field, specify the protocol or leave Any to allow traffic over any protocol.
      5. In the Source or Destination field, select the scope of the rule:
        • CIDR: Rule will apply to a range of IP addresses. In the CIDR blocks field, specify the CIDR and masks of subnets that traffic will come to or from. To add more CIDRs, click Add CIDR.
        • Security group: Rule will apply to the current or the selected security group VMs.
      6. Click Save. Repeat these steps to create all rules from the table.
    5. Click Save.

Create a VM with a pre-installed web serverCreate a VM with a pre-installed web server

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

  2. Under Boot disk image, enter LAMP or LEMP in the Product search field and select the VM image with the components you need:

    • LAMP for Linux, Apache, MySQL®, and PHP

    • LEMP for Linux, Nginx, MySQL®, and PHP

      For static websites, we recommend using LEMP.

  3. Under Location, select the availability zone to create your VM in. If you are not sure which one to choose, leave the default.

  4. Under Computing resources, navigate to the Custom tab and specify the required platform, number of vCPUs, and amount of RAM. This minimum configuration is enough for functional website testing:

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

    • In the Subnet field, select web-network and the subnet to create your VM in.
    • Under Public IP address, leave Auto to assign a random external IP address from the Yandex Cloud pool to your VM. Alternatively, select a static address from the list if you reserved one.
  6. Under Access, select SSH key and specify the VM access credentials:

    • Under Login, enter the username. Do not use root or other names reserved for the OS purposes. For operations 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 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 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.

  7. Under General information, specify the VM name: lamp-vm or lemp-vm. The naming requirements are as follows:

    • It must be from 2 to 63 characters long.
    • It can only contain lowercase Latin letters, numbers, and hyphens.
    • It must start with a letter and cannot end with a hyphen.
  8. Click Create VM.

    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.

  9. Click Create VM.

    It may take a few minutes to create your VM. When the VM status changes to RUNNING, you can upload the website files to it.

Upload the website filesUpload the website files

To test the web server, upload the index.html file to the VM. You can use a test file. Download and unpack the archive.

  1. Find the VM public IP address under Network on the VM page in the management console.

  2. Connect to the VM via SSH.

  3. Grant your user write permissions for the /var/www/html directory:

    sudo chown -R "$USER":www-data /var/www/html
    
  4. Upload the website files to the VM via SCP.

    Linux/macOS
    Windows

    Use the scp command line utility:

    scp -r <path_to_directory_with_files> <VM_user_name>@<VM_IP_address>:/var/www/html
    

    Use WinSCP to copy the local file directory to /var/www/html on the VM.

Configure DNSConfigure DNS

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

Below we describe how to configure the DNS for the example.com domain name. The example.com domain name must be mapped to the VM IP address using DNS records. To do this:

Management console
  1. In the management console, select Compute Cloud.

  2. Copy the IP address of the VM you created.

  3. On the website of your DNS hosting provider, navigate to the DNS settings.

  4. Create or edit the A record for example.com so that it points to the copied IP address:

    example.com. A <VM_IP_address>
    
  5. Create a CNAME record named www with example.com as its value.

    If you use Yandex Cloud DNS, follow this tutorial to configure the record:

    Configuring DNS records for Cloud DNS
    1. In the management console, select Cloud DNS.
    2. If you do not have a public DNS zone, create one:
      1. Click Create zone.
      2. Specify the zone Name: example-zone-1.
      3. In the Zone field, enter the website domain name with a trailing dot: example.com..
      4. Select the zone Type: Public.
      5. Click Create.
    3. Create an A record:
      1. In the list of zones, click example-zone-1.
      2. Click Create record.
      3. Leave the Name field empty for the record to match the example.com domain name rather than a name with a subdomain, e.g., www.example.com.
      4. Select the record Type: A.
      5. In the Data field, paste the copied IP address of the VM.
      6. Click Create.
    4. Create a CNAME record:
      • Select the example.com DNS zone from the list.
      • Click Create record.
      • Specify the record settings:
        • Name: www.
        • Record type: Select CNAME.
        • TTL (record time to live): Keep the default value.
        • Value: Enter example.com.
      • 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 (ns1.yandexcloud.net and ns2.yandexcloud.net) are created.

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

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 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 or domain name in your browser:

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

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

To stop paying for the resources you created:

Management console
  1. Delete lamp-vm (lemp-vm).
  2. Delete the static public IP address if you reserved one for your VM.
  3. Delete the DNS records and delete the DNS zone if you used Cloud DNS.

See alsoSee also

  • Website based on LAMP or LEMP stack using Terraform.

Was the article helpful?

Previous
Overview
Next
Terraform
© 2025 Direct Cursus Technology L.L.C.