Sitemap
Zerops

A Dev-First Cloud Platform that builds, deploys, runs and manages your apps, no matter the size or environment.

How to deploy Astro on Zerops (in 3 mins)

3 min readApr 22, 2024

--

Press enter or click to view image in full size

Hey everyone, this guide will walk you through deploying an AstroJS web app on a Node.js service using Zerops, a bare-metal cloud platform. Unlike Vercel, which is a wrapper on top of AWS, Zerops offers a straightforward onboarding process. If you’re building a project intended to serve a large number of users, Zerops might be a better choice compared to GCP, AWS, and Azure.

There are two ways to push your code to Zerops: using the zCLI or the GitHub repository method. In this guide, we’ll focus on using the zCLI. Make sure to download the zCLI first so you can follow along with the steps.

FIRST, GO TO THE ZEROPS DASHBOARD AND ADD A NEW PROJECT

Press enter or click to view image in full size

CREATE A NEW SERVICE WITH NODEJS AND SCROLL DOWN TO ADD

Press enter or click to view image in full size

CHANGE THE HOSTNAME TO YOUR PREFERRED NAME

Press enter or click to view image in full size

ADD THE NEW NODE.JS SERVICE TO CONTINUE

Press enter or click to view image in full size

COPY THE ZEROPS.YML CODE

Press enter or click to view image in full size

CREATE A ZEROPS.YML FILE IN THE ROOT OF YOUR PROJECT AND PASTE THE YAML CODE THERE (I REMOVED ALL THE COMMENTS) AND ASLO ADD

zerops:
- setup: astro
build:
base: nodejs@20
buildCommands:
- npm i
- npm run build
deploy:
- dist
- package.json
- node_modules
cache:
- node_modules
- package-lock.json
run:
start: npm start
envVariables:
HOST: 0.0.0.0
Press enter or click to view image in full size

ADD @ASTROJS/NODE TO YOUR PROJECT

Press enter or click to view image in full size

MATCH YOUR ASTRO CONFIG WITH MINE(IGNORE TAILWIND IF YOU ARE NOT USING IT)

Press enter or click to view image in full size

TYPE “ZCLI PUSH” & CHOOSE THE RIGHT PROJECT WITH ARROWS AND CLICK ENTER

Press enter or click to view image in full size

CLICK ENTER TO CONTINUE

Press enter or click to view image in full size

IT WILL WILL PUSH THE CODE AND THEN DEPLOY IT (IF IT FAILS IT’LL LET YOU KNOW)

Press enter or click to view image in full size

GO TO SERVICES DASHBOARD AND CHECK THE CI/CD PIPELINE TO CHECK THE BUILD LOGS

Press enter or click to view image in full size

WELL THIS IS WORKING

Press enter or click to view image in full size

CHANGE THE DEFAULT 3000 PORT TO 4321 FROM INTERNAL PORTS

Press enter or click to view image in full size

VOILAAAA!!

Press enter or click to view image in full size

Examples : Zerops-Astro-Nodejs / Astro-with-Tailwind

Get Arjun Aditya’s stories in your inbox

Join Medium for free to get updates from this writer.

For more info kindly check Zerops Docs and Zerops Discord Server

--

--

Zerops

Published in Zerops

A Dev-First Cloud Platform that builds, deploys, runs and manages your apps, no matter the size or environment.