Deploy your Astro Site with Railway
Questi contenuti non sono ancora disponibili nella tua lingua.
Railway is a deployment platform built to simplify your infrastructure stack from servers to observability with a unified developer experience.
This guide is for deploying an Astro static site to Railway using either the web interface or Railway CLI tool.
To deploy an Astro site with on-demand rendering (SSR) using the Node adapter, you can follow Railway’s guide to deploying an Astro site.
Project Configuration
Section titled “Project Configuration”Railway’s default build system, Railpack, automatically builds your Astro project as a static site.
Deploy via a Railway template
Section titled “Deploy via a Railway template”If you do not already have an Astro project, and are starting from scratch:
-
Go to the Astro template on Railway: railway.com/deploy/astro-starter.
-
Click “Deploy Now” and sign in with your GitHub account to authorize Railway. This will deploy the Astro template into your new Railway account.
-
Eject the service code into your own Github repository by following this guide. This will allow you to keep the repo deployed but customize it with your own code.
Deploy via the web interface
Section titled “Deploy via the web interface”If you have an existing Astro project you would like to deploy but not a Railway account yet:
-
Create a Railway account and sign in.
-
From the Railway dashboard, create a new project.
-
Select the option to deploy from a GitHub repository, and select your Astro project.
-
Generate or add a custom domain from your project’s network settings.
Deploy via Railway CLI
Section titled “Deploy via Railway CLI”If you have an existing Astro project you would like to deploy and an existing Railway account:
-
Install the Railway CLI tool.
-
Login with the command
railway login. -
From within your Astro project, run
railway initand choose a workspace and project name. -
Run
railway upto deploy your project on Railway. -
Run
railway domainto generate a Railway provided service domain.
Official Resources
Section titled “Official Resources”Community Resources
Section titled “Community Resources”How to host an Astro site on Railway