Provider guide

Host Next.js on an Azure Linux VM

Deploy Next.js on an Azure Linux VM with resource groups, NSG rules, a static public IP, DNS, TLS, and a transparent cost example.

By HostNextJS Editorial TeamReviewed by HostNextJS Technical Review Published Updated
01Typeprovider
02Last reviewed
03Update policyQuery the retail price example every 30 days; review VM, public IP, NSG, and DNS guidance every 90 days or after a material Azure change.
Provider-specific scope

What is specific to Microsoft Azure

This guide uses an Azure Resource Manager Linux virtual machine and its surrounding resources: resource group, virtual network, network interface, managed OS disk, Standard public IP, network security group, and optional Azure DNS zone. It is not an Azure App Service or Static Web Apps guide.

Products and locations

Choose the right provider surface

  • 01Burstable B-series VMs suit low-average-CPU workloads but use a credit model; choose another VM family when the application needs sustained predictable CPU.
  • 02VM sizes, prices, availability zones, and features differ by Azure region and subscription; place the VM with its data services and verify quota before deployment.
Before you start

Prerequisites

  • 01An active Azure subscription with permission to create the full resource set
  • 02An SSH public key and a domain you control
  • 03A tested Next.js production artifact
  • 04A cost budget, monitoring, backup, and rollback plan
Manual path

Deployment sequence

  1. 01Create the Azure resource set

    Create or select a resource group, region, virtual network, subnet, Linux VM image and size, SSH key, managed disk, and Standard public IP. Use clear environment tags.

  2. 02Configure the NSG

    Create explicit inbound allow rules for HTTP and HTTPS, restrict SSH by source, and rely on the lower-priority default deny for unmatched inbound traffic.

  3. 03Deploy the application

    Install a supported Node.js version, deploy a controlled standalone or production build, and supervise the unprivileged process behind Nginx or another proxy.

  4. 04Configure DNS, TLS, and validation

    Create an A record for the static public IP in Azure DNS or the existing DNS service, issue TLS, test critical behavior, and retain a rollback target.

Network and domain

Firewall, DNS, and TLS

  • 01Use a Standard static public IP so DNS does not depend on an address that can change across resource lifecycle events.
  • 02Associate the intended NSG with the network interface or subnet and understand that both associations can affect the effective rules.
  • 03Allow public TCP 80 and 443, restrict TCP 22 to administrative CIDRs, and never add a public rule for the Next.js port.
  • 04Delegate the domain to Azure DNS only when intended; otherwise create the A record at the current authoritative provider and automate TLS renewal.
Dated examples

Cost reference

01 · Standard B1ms compute in East USUSD 0.0207/hour

Linux consumption meter from the Azure Retail Prices API, effective 2025-10-01 and checked 2026-07-12; roughly USD 15.11 for 730 hours of compute only.

02 · Complete VM estimateUse Azure Pricing Calculator

Add managed disk, public IPv4, backups, monitoring ingestion, bandwidth, support, tax, and any reservations or savings plan before approving a budget.

HostNextJS is independent and is not affiliated with or endorsed by Microsoft. Azure and related product names are Microsoft trademarks.

An Azure Linux VM fits teams that already use Azure identity, networking, policy, procurement, or adjacent data services. It is rarely the smallest infrastructure decision: the deployable unit includes the VM and several surrounding resources that need ownership and cost controls.

Model the complete Azure resource set

Keep the VM, network interface, public IP, network security group, and managed disk in a deliberately named resource group. Use tags for environment and ownership. Deleting the VM does not always mean every attached or neighboring billable resource is deleted, so document cleanup and audit the group after replacements.

B-series VMs accumulate and spend CPU credits. They can be economical for low-average-CPU services but are a poor default when builds or production requests need sustained CPU. Build in CI where practical and select a non-burstable family when measurements show the need.

Make effective NSG rules reviewable

Network security groups are stateful, priority-ordered rule sets. Azure includes a final inbound deny rule, so add only the required allows. If NSGs are associated with both the subnet and network interface, traffic must survive both sets of effective rules. Review the effective security rules on the VM rather than assuming one portal screen is the whole policy.

Use a static Standard public IP for a public single-VM deployment. Keep port 3000 or the configured Next.js listener private and route public 80/443 through the reverse proxy.

Budget and recover as a system

The displayed compute meter is not the complete server price. Use the Azure calculator with the exact region, hours, disk tier, public IP, backup, monitoring ingestion, and expected egress. Add alerts and budgets, but remember that alerts do not stop resources automatically.

Back up state outside the deployment artifact and test restoration. Before DNS cutover, validate the candidate VM with the production hostname, TLS, dynamic routes, images, streaming, cache behavior, and shutdown handling. Preserve a compatible prior target until rollback is no longer required.

Methodology

How this resource was produced

The guide maps an Azure Resource Manager Linux VM, managed disk, Standard public IP, virtual network, network security group, and Azure DNS or external DNS to the Next.js Node.js self-hosting model. The compute example comes from the public Retail Prices API and excludes attached resources.

Limitations
  • 01

    An Azure VM is only one billable resource in the deployment; disk, public IP, backup, monitoring, bandwidth, and data services can materially exceed the compute line.

  • 02

    Burstable VM credits can make a low average price unsuitable for sustained builds, image processing, or CPU-heavy traffic.

  • 03

    Azure's resource and networking model adds governance value for established teams but more configuration than a simple VPS.

FAQ

Questions about host next.js on an azure linux vm.

No fog. Just the practical details developers need before moving a production app.

Why not use Azure App Service for Next.js?

App Service is a managed application platform with different deployment and scaling behavior. Use a Linux VM when operating-system and reverse-proxy control are explicit requirements.

Is the B1ms compute price the whole monthly bill?

No. It is one Linux compute meter in one region. The managed disk, public IP, backups, monitoring, transfer, support, and taxes are separate.

Next step

Turn the resource into a deployment decision.

Plan an Azure deployment