embedchain/docs/deployment/railway.mdx
It's easy to host your Embedchain-powered apps and APIs on railway.
Follow the instructions given below to deploy your first application quickly:
pip install embedchain
To use your hosted embedchain RAG app, you can easily set up a FastAPI server that can be used anywhere. To easily set up a FastAPI server, check out Get started with Full stack page.
Hosting this server on railway is super easy!
</Tip>You can create a Dockerfile in the root of the project, with all the instructions. However, this method is sometimes slower in deployment.
By default, Railway uses Python 3.7. Embedchain requires the python version to be >3.9 in order to install.
To fix this, create a .python-version file in the root directory of your project and specify the correct version
3.10
You also need to create a requirements.txt file to specify the requirements.
python-dotenv
embedchain
fastapi==0.108.0
uvicorn==0.25.0
embedchain
beautifulsoup4
sentence-transformers
Select Empty Project or Deploy from Github Repo.
You should be all set!
You can also use the railway CLI to deploy your apps from the terminal, if you don't want to connect a git repository.
To do this, just run this command in your terminal
npm i -g @railway/cli
railway login
railway link [projectID]
Finally, run railway up to deploy your app.
railway up
If you run into issues with deployment, please feel free to reach out to us via any of the following methods:
<Snippet file="get-help.mdx" />