Railway
Edit this pageRailway is a well-known platform for deploying a variety of web and cloud-based projects. For an in-depth look at the features offered by Railway, as well as detailed deployment guidelines, you can consult the Railway documentation.
Adjust the Start command
To begin, you need to update the start command in your package.json
file to make it compatible with Railway.
Change the start command to npx http-server ./dist
instead of using vite
.
This adjustment means you will need to build the app to generate the dist
folder.
For local development, continue using the original dev
command.
Reserve the modified start command specifically for Railway deployments.
Below is an example of how your package.json
may be configured:
Using the Railway web interface
- Visit Railway's homepage and click "Start a New Project." You will be redirected to connect with GitHub. Log in or create an account using your GitHub credentials and authorize Railway to access your account.
- After authorization, choose the repository that has your Solid project. During this step, you can also add any required environment variables.
- Once your project is configured, click "Deploy Now." After a successful deployment, a confirmation screen will appear.
- Railway does not automatically assign a domain to your project. To do this, go to the settings and manually generate a domain for your deployed project.
Once a domain has been generated, your Solid project should be live.
Using the Railway CLI
- Using your preferred package manager and install the Railway CLI:
- Open your terminal and run the following command to log in:
-
You have the option to link your local Solid project to an existing Railway project using railway link. Alternatively, you can create a new project with
railway init
and follow the on-screen prompts. -
To deploy your project to Railway, use the following command:
Your project will now be live on Railway.