Deploying your App

Railway

Edit this page

Railway 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:

"scripts": {
"start": "npx http-server ./dist",
"dev": "vite",
"build": "vite build",
"serve": "vite preview",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
},

Using the Railway web interface

  1. 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.
  1. After authorization, choose the repository that has your Solid project. During this step, you can also add any required environment variables.
  1. Once your project is configured, click "Deploy Now." After a successful deployment, a confirmation screen will appear.
  1. 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

  1. Using your preferred package manager and install the Railway CLI:
  1. Open your terminal and run the following command to log in:
railway login
  1. 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.

  2. To deploy your project to Railway, use the following command:

railway up
# or
railway up --detach # if you prefer to avoid logs

Your project will now be live on Railway.

Report an issue with this page