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 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 May 7, 2025
  • Prepare your cloud environment
    • 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. Prepare your cloud environment.
  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.

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 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 the resources created in the use case 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 a Name for the group: 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 /
      target
      CIDR blocks
      Outgoing any All Any CIDR 0.0.0.0/0
      Incoming ext-http 80 TCP CIDR 0.0.0.0/0
      Incoming ext-https 443 TCP CIDR 0.0.0.0/0
      1. Select the Outgoing traffic or Incoming traffic tab.
      2. Click Add rule.
      3. In the Port range field of the window that opens, specify a single port or a range of ports that traffic will come to or from.
      4. In the Protocol field, specify the appropriate protocol or leave Any to allow traffic transmission over any protocol.
      5. In the Purpose or Source field, select the purpose of the rule:
        • CIDR: Rule will apply to the 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 multiple CIDRs, click Add CIDR.
        • Security group: Rule will apply to the VMs from the current group or the selected security group.
      6. Click Save. Repeat the steps to create all the 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 page in 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 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 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, 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 access credentials for the VM:

    • Under Login, enter a username. Do not use root or other names reserved by the OS. To perform operations requiring superuser 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: lamp-vm or lemp-vm. The name should match the following format:

    • It must be from 2 to 63 characters long.
    • It may 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 site of your DNS hosting provider, go 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 guide 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's domain name with a trailing dot: example.com..
      4. Select a Type of the zone: 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 parameters:
        • 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. 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 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
Yandex project
© 2025 Yandex.Cloud LLC