How to keep a discord bot up
Anonymous
FREEOP

3 months ago

Hi i need help please I already have a discord bot coded n all I want to know how I can keep it up with railway

Solved

114 Replies

3 months ago

Could you send me a screenshot of the project structure?


Anonymous
FREEOP

3 months ago

not exactly sure what a project structure is but these are js the files composed for the bot

Screenshot_2026-02-27_145352.png

Attachments


3 months ago

thats exactly what I was looking for


3 months ago

neat, looks good


3 months ago

do you have this on GitHub?


Anonymous
FREEOP

3 months ago

no


3 months ago

There's 2 ways you can go about deploying this on Railway:

  1. via GitHub (recommended)
  2. via CLI

GitHub would require a lot more setup while the CLI is faster


3 months ago

Either way is fine, it's up to you


3 months ago

If you already know how to use GitHub then I'd recommend the GitHub way now

otherwise i'd recommend the CLI way just to get it up and running, then you can figure out GitHub later


Anonymous
FREEOP

3 months ago

ok tysm i dont rlly know much abt github yet so ill use cli for now


Anonymous
FREEOP

3 months ago

thanks for the help <:salute:1137099685417451530>


3 months ago

no problemo


Anonymous
FREEOP

3 months ago

wait sorry what does cli stand for?


3 months ago

I'm assuming you dont have the CLI installed


3 months ago

command line interface


3 months ago

What operating system are you using?


Anonymous
FREEOP

3 months ago

windows


3 months ago

could open the search bar, type in cmd and hit enter, Command Prompt should pop up


Anonymous
FREEOP

3 months ago

and then?


3 months ago

try entering:

npm --version

3 months ago

i'm trying to see if you have npm installed or not


3 months ago

if you do then we can install railway's cli via npm


3 months ago

if not then i'm going to give you a different command to install something called scoop which you can use to install railway cli


3 months ago

just lmk what it says


Anonymous
FREEOP

3 months ago

yea i dont have npm


3 months ago

oh okay


3 months ago

in that case we can install scoop ()

in the command prompt window, try entering:

powershell

this'll append PS a the far left of the command line, let me know if you see that


3 months ago

what this does is we're switching from command prompt over to powershell because scoop's install command requires us to use powershell


Anonymous
FREEOP

3 months ago

yea done do i just install it?


Anonymous
FREEOP

3 months ago

Screenshot_2026-02-27_150528.png

Attachments


3 months ago

perfect!


3 months ago

the next step is the installation step


3 months ago

you'll want to copy and paste this in there:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression

-# Note: dont just run random commands that people give you online, its bad security practice, you can copy and paste the command directly from the scoop's website via the link I shared above


Anonymous
FREEOP

3 months ago

done


3 months ago

neat, now can you try running

scoop install railway

Anonymous
FREEOP

3 months ago

finished


3 months ago

now can you try running:

railway --version

3 months ago

just to verify that Railway's CLI was installed


Anonymous
FREEOP

3 months ago

this good?

Screenshot_2026-02-27_150858.png

Attachments


3 months ago

yes that is exactly what we needed


3 months ago

Railway's CLI is installed now, so we're almost done


3 months ago

you'll want to run

railway login

and follow the steps

this will log you in on the CLI so you can upload your project, once you're done, run:

railway whoami

so you can confirm you're logged in


Anonymous
FREEOP

3 months ago

done


3 months ago

perfect, now switching to

you'll want to make a project if you havent already, and then an empty service


3 months ago

we need to do this so we have a destination for your project when we upload it

the empty service will be its destination


Anonymous
FREEOP

3 months ago

finished


3 months ago

perfect, now on window's file explorer you'll want to go to your project files


3 months ago

right here


3 months ago

once you're there, do you see this top bar?

mine says "Downloads/SomeProject", yours will say something else

image.png

Attachments


3 months ago

you'll want to click on it, erase everything and type cmd


3 months ago

this will open command prompt on the destination of your project


Anonymous
FREEOP

3 months ago

oki done


3 months ago

now just to make sure we're on the right location, try typing dir in there


3 months ago

then make sure it shows your main.py, requirements.txt and so on


3 months ago

we dont want to accidentally upload your entire computer to railway, we just want your project, so its important we make sure its at the right location


Anonymous
FREEOP

3 months ago

its showing this instead

Screenshot_2026-02-27_151753.png

Attachments


3 months ago

ah, you're on your C drive, good thing we checked, that would unironically have tried uploading your entire computer 💀


3 months ago

I'm not sure how that happened <:Thinking:1360710341239242762> it should've opened command prompt at your project's location


Anonymous
FREEOP

3 months ago

should i replicate file and move the entire thing in a separate location?


3 months ago

no matter, can you go back to your project folder and then do the same thing I asked you before but instead of erasing everything and typing cmd, just copy it


3 months ago

no no you're fine


Anonymous
FREEOP

3 months ago

done


3 months ago

if the file path itself isn't sensitive, could you paste it here?


Anonymous
FREEOP

3 months ago

C:\Users\X-Game\OneDrive\Documents\UKM (2).zip\UKM\Attendance


3 months ago

🤨 .zip


Anonymous
FREEOP

3 months ago

ah its a zip file


3 months ago

is that the folder's name?


3 months ago

yea you're gonna need to unzip that first


Anonymous
FREEOP

3 months ago

done


Anonymous
FREEOP

3 months ago

C:\Users\X-Game\OneDrive\Documents\UKM\Attendance


3 months ago

awesome, and that Attendance folder holds your main.py and requirements.txt right?


Anonymous
FREEOP

3 months ago

yes


3 months ago

my bad, im back, had to go help a friend with something


Anonymous
FREEOP

3 months ago

no worries


3 months ago

now go back to command prompt and type:

cd C:\Users\X-Game\OneDrive\Documents\UKM\Attendance

3 months ago

this will take you to that folder


3 months ago

feel free to run dir again to make sure you see main.py and requirements.txt


Anonymous
FREEOP

3 months ago

yea done


3 months ago

nice


3 months ago

now, you can run railway link


3 months ago

run through the steps and select the empty service we created earlier


3 months ago

once you've done that, you can run railway up to upload your project to railway


Anonymous
FREEOP

3 months ago

do i put this in the cmd?


3 months ago

yea


Anonymous
FREEOP

3 months ago

this is what im seeing after typing it

Screenshot_2026-02-27_153451.png

Attachments


3 months ago

yea you're gonna wanna select the project you created earlier


3 months ago

which i assume is that one right there


3 months ago

then the service you created earlier


Anonymous
FREEOP

3 months ago

done <:salute:1137099685417451530>

Screenshot_2026-02-27_153626.png

Attachments


3 months ago

niceee


3 months ago

now final step


3 months ago

railway up

3 months ago

to upload it to that service


3 months ago

then you can go back to the UI and watch it deploy


3 months ago

hopefully Railway will automatically detect the project structure and you wont have to do anything else


3 months ago

but otherwise if it fails we might need some more manual configuration


Anonymous
FREEOP

3 months ago

no its building it rn


Anonymous
FREEOP

3 months ago

tysm for guiding me through it step by step i heavily appreciate it <:salute:1137099685417451530>


Anonymous
FREEOP

3 months ago

its online now


3 months ago

it's no problem at all


3 months ago

im just happy i could help


3 months ago

the bot as well?


Anonymous
FREEOP

3 months ago

mhm


Anonymous
FREEOP

3 months ago

this is my first college project it means a lot <33


3 months ago

nice congratulations on hosting your first college project


3 months ago

I'd heavily heavily heavily recommend learning GitHub and using GitHub for future deploys, it's the standard way to not only store your projects but also deploy them to any other hosting service like Railway


3 months ago

but for now the CLI should work fine, if you update your code then just run railway up again


3 months ago

(make sure you run it from a command prompt that is set to your project folder)


Anonymous
FREEOP

3 months ago

note taken


Anonymous
FREEOP

3 months ago

<:salute:1137099685417451530>


Anonymous
FREEOP

3 months ago

oh sorry one last thing is there any way for me to stop/pause it? I don't want to use up all my free credits in one go <:mildpanic:804271964587819059>


3 months ago

there's no way to pause it through the UI unfortunately, but you can achieve the same thing by going to the service on railway's website, clicking on the 3 dots and clicking "Remove" - if you ever want it running again you can just go to the removed deployment, click on the 3 dots and click "Redeploy" (or just run railway up again)


Anonymous
FREEOP

3 months ago

ok thats it for me again tysm you've been really sweet <:salute:1137099685417451530>


3 months ago

I'm happy I could help 🙂


Status changed to Solved dev 2 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...