Best Practice Questions
cornett
PROOP

a month ago

I'm new to Railway. Have been poking around this week but have 2 scenarios I'm looking for guidance on.

  1. Using Ollama to host a small embeddings model. Normally I would just SSH into my server and run something like ollama pull nomic-embed-text from the command line. Since I can't do that with Railway what's the best practice for similar services? (I ended up turning on a public URL, using Ollama's CURL endpoit, running a command, then turning off the public URL. That worked in this case, but not every CLI tool has a CURL endpoint.)
  2. Run WordPress with a custom theme? Assume it is something like mount a volume at /wp-content/themes/ and hook that to GitHub somehow. But it looks like all the WordPress template at /deploy are mounted to /var/www/html already.
$20 Bounty

Pinned Solution

ilyass012
FREE

a month ago

Hey, so for ollama and similar cli tools on railway you generally should not rely on manually running commands inside the container as a workflow the safe pattern is to run any required setup like ollama pull in the service start command or entrypoint script and attach a persistent volume (for ollama typically /root/.ollama) so the model is downloaded once and reused across restarts if you need ad hoc access you can use railway ssh but that is mainly for debugging not regular setup

for wordpress custom themes do not mount a volume for themes volumes are for runtime data like uploads instead put your theme in your repo and copy it into /var/www/html/wp-content/themes/ via a dockerfile and connect that repo to railway so deploys are handled through git the existing volume on /var/www/html is for persistence but your theme code should come from the image to keep it versioned and consistent

5 Replies

You can SSH into your service using Railway. You just right-click on your service and select copy ssh command (you need to have railway cli installed).


You can check the docs here to set up Railway cli: https://docs.railway.com/cli


ilyass012
FREE

a month ago

Hey, so for ollama and similar cli tools on railway you generally should not rely on manually running commands inside the container as a workflow the safe pattern is to run any required setup like ollama pull in the service start command or entrypoint script and attach a persistent volume (for ollama typically /root/.ollama) so the model is downloaded once and reused across restarts if you need ad hoc access you can use railway ssh but that is mainly for debugging not regular setup

for wordpress custom themes do not mount a volume for themes volumes are for runtime data like uploads instead put your theme in your repo and copy it into /var/www/html/wp-content/themes/ via a dockerfile and connect that repo to railway so deploys are handled through git the existing volume on /var/www/html is for persistence but your theme code should come from the image to keep it versioned and consistent


cornett
PROOP

a month ago

Thanks for the quick reply and the help.


Status changed to Solved chandrika about 1 month ago


ilyass012

Hey, so for ollama and similar cli tools on railway you generally should not rely on manually running commands inside the container as a workflow the safe pattern is to run any required setup like ollama pull in the service start command or entrypoint script and attach a persistent volume (for ollama typically /root/.ollama) so the model is downloaded once and reused across restarts if you need ad hoc access you can use railway ssh but that is mainly for debugging not regular setup for wordpress custom themes do not mount a volume for themes volumes are for runtime data like uploads instead put your theme in your repo and copy it into /var/www/html/wp-content/themes/ via a dockerfile and connect that repo to railway so deploys are handled through git the existing volume on /var/www/html is for persistence but your theme code should come from the image to keep it versioned and consistent

cornett
PROOP

a month ago

Thanks, this is the best and most helpful reply.


Status changed to Awaiting Railway Response Railway 30 days ago


Status changed to Solved cornett 30 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...