---
title: "Cloud server with Node.js"
sidebar_label: "Node.js"
sidebar_position: 6
toc_max_heading_level: 3
description: "How to create a cloud server with a container registry"
---

import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'
import {CustomTable} from '@selectel/docux/components'
import Formbricks from '@theme/MDXComponents/Formbricks'
import CopyIcon from '@selectel/docux/icons/copy'
import CreateServer from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/cloud-servers/applications/create-server-for-apps.mdx'

# Cloud server with Node.js

Node.js is a cross-platform environment that allows you to create fast and scalable network applications in JavaScript.

You can [create a cloud server with Node.js](#create-cloud-server-with-node-js). In Russia, the application runs on a cloud server with a pre-configured [SelectOS 1 64-bit](https://selectos.selectel.ru/news/mega/) operating system. In other [countries](/infrastructure/locations.mdx#country) — Ubuntu 24.04.

Before creating a cloud server with an application, review the [software license agreements](https://423.selcdn.ru/kb/license-agreements-for-application-images-LANG.pdf) included in the image.

## Minimum resource requirements \{#minimum-requirements}

<CustomTable>
  <table>
    <tbody>
      <tr>
        <th>vCPU count</th><td>2</td>
      </tr>

      <tr>
        <th>RAM</th><td>4 GB</td>
      </tr>

      <tr>
        <th>Boot volume</th><td>16 GB</td>
      </tr>
    </tbody>
  </table>
</CustomTable>

## Create a cloud server with Node.js \{#create-cloud-server-with-node-js}

For Monitoring Box to work, the cloud server must be accessible from the internet. To do this, when creating a server, you need to create a private subnet and attach a public floating IP address. To set up Monitoring Box, you must specify user data — custom operating system configuration parameters — when creating the server.

1. [Create a public floating IP address](#create-floating-ip).

2. [Create a cloud server with Node.js](#create-node-js-server).

### 1. Create a public floating IP address \{#create-floating-ip}

Create a public floating IP address so that the cloud server with Node.js is accessible from the internet.

Use the [Create a public floating IP address](/cloud-servers/cloud-networks/public-floating-ip-addresses.mdx#create-public-floating-ip) section of the [Public floating IP addresses](/cloud-servers/cloud-networks/public-floating-ip-addresses.mdx) guide.

### 2. Create a server with Node.js \{#create-node-js-server}

<CreateServer AppNameInPanel="Cloud Nodejs" MinConfig="2 vCPU, RAM starting from 4 GB and a boot disk size starting from 16 GB" OptionalVolumes="Optional: add an additional" VolumeSize="Specify the size of the network disk in GB or TB" />

<div style={{paddingLeft:'2em'}}>
  ```yaml
  #cloud-config

  write_files:
  - path: "/opt/gomplate/values/user-values.yaml"
    permissions: "0644"
    content: |
      AppName: <app_name>
      AppPort: <port_number>
      GitRepo: <git_repository_url>
      GitBranch: <branch_name>
      EnvVars: |
    NODE_ENV=production
    DB_HOST=localhost
    DB_PORT=5432
  ```

  Specify:

  * `<app_name>` — the application name to be run on the cloud server;
  * `<port_number>` — the port to use for connecting to the application;
  * `<git_repository_url>` — the URL of the Git repository containing the application source code;
  * `<branch_name>` — the Git repository branch to be cloned to the cloud server.
</div>

## Run a custom application \{#start-app-build}

When you connect to the cloud server via SSH for the first time, select the Node.js version.

When the cloud server boots for the first time, the Git repository branch you specified in the User data during [server creation in step 2](#create-node-js-server) will be automatically cloned.

Then, Node.js dependencies are installed and the application build is triggered. To execute the build, the `package.json` file must contain the `start` and `build` scripts.

Use a separate database server or Managed Database to store the data.

After the build is complete, the application will launch as a systemd service named `nodejs-<app_name>.service`, where `<app_name>` is the application name you specified in the User data during [server creation in step 2](#create-node-js-server).

The application will be available at `http://<public_ip_address>:<port_number>`.

Where:

* `<public_ip_address>` — public floating IP address that you specified when [creating the server in step 2](#create-node-js-server);
* `<port_number>` — the port you specified in the User data during [server creation in step 2](#create-node-js-server).

<Formbricks />
