How to make a glitch project to run constantly?

Hi all,

I’m using Glitch to host my discord bot, that needs to be online 24/7.

I’ve seen many tutorials on getting glitch to run 24/7, but none seem to work.

Do you have any ideas on how I could do this?

1 Like

Hey @ClinkMakesGames! There are quite a few ways to get your Discord bot running 24/7 with no issues. The best way that I know of is to use UptimeRobot to ping your bot.

After registering an account on UptimeRobot it should redirect you to your dashboard (if it doesn’t, then go to the home page and click Login or click here). Once in your dashboard, click + Add New Monitor. Under Monitor Information there will be a dropdown with the following options:

Select HTTP(s), and when you do so 2 text boxes and a slidable bar should appear. In Friendly Name* give the monitor whatever name you please. In URL (or IP)* type in your Glitch project’s name follow by .glitch.me;

Leave the Monitoring Interval* bar at 5 minutes; the exact amount of time your bot will stay awake on its own before sleeping.

In Select “Alert Contacts To Notify” just check the first email that pops up (there should be only one unless you’ve added more). Then click Create Monitor, and that’s it! Give the website a few minutes and make sure you’ve exited out of your bot’s Glitch page (to ensure that UptimeRobot is keeping it awake and not you since your bot stays on when you’re viewing the page).

If you have any other issues I’m free to talk, but I really hope this works well for you as it has for me and many others! :slight_smile:

5 Likes

Ever tried this guide ?

https://thelearneer.gitbooks.io/discord-js-glitch-hosting/

1 Like

This works! Thank you!

2 Likes

I still cant get it working did everything you said and still cant got discord? if so mine is :crown: 𝕿𝖍𝖊𝕯𝖊𝖆𝖙𝖍𝕾𝖙𝖗𝖊𝖆𝖒𝖊𝖗√#6228, Thanks!

Are you getting any errors from it?

You could also just create a simple websocket server and connect to it and have that ping at least once every 5 minutes, that will keep your bot running and the server will be up as well, but I recommend pinging once every 30 seconds. Make sure this is not made in the same project as your main project folder. Glitch shuts down applications after 12 hours of running, so if you do that, the whole application stops and no pings will be sent.

It isn’t showing the page! Can you send a new link?

This method seems not working anymore.

Hi @YzY229, welcome to the Glitch Forums!

If you mean that using UptimeRobot’s not working to keep your project awake then can you give us some more details? Project name, UptimeRobot config, any errors you’re seeing in the Logs pane? As far as I knowledge lots of other folks are using UptimeRobot successfully.

Isnt working for me too, I did all exactly steps showed here.

Assuming I’ve got the right project for your case @Zoilken, the problem is probably that your app’s not serving anything at its homepage url. I’m not a Flask expert, so I’m not quite sure what’s wrong in there, but even just returning “Hello World!” from your root() method would mean there’d be a page there - without a page of some sort there UptimeRobot has nothing to load to keep your project from sleeping (and that’s also why UR thinks your app is down).

@YzY229 again assuming I’ve got the right projects based on my guesswork from the screencast you sent, your problem seems like it’s the same root problem that @Zoilken is having: your projects aren’t serving a webpage at the address that you’ve configured UptimeRobot to load and so 1) UptimeRobot thinks your project is down because there’s nothing at the address you told it to watch and 2) because UptimeRobot can’t load anything where you told it to look it’s not actually keeping your project from sleeping.

You’ve still got Express in your package.json files (at least the ones I looked at) so you need to do something like what you see in this file in our Express starter project. Basically, set up the Express app, tell it to do something when someone requests the homepage of your app, and start listening to the appropriate port You could probably copy the contents of that file and paste them at the bottom of your server.js file (assuming you have a file to render at the location listed here) and everything would work fine.

1 Like


Copied everything and don’t know why only one is up in the dashboard even I have loaded up four of the bot’s page.

(I have tested it and it didn’t work. So I try to load up the four pages and see how the uptimerobot page react.)

@YzY229 can you post screenshots of your UptimeRobot configuration for the ones that appear down?

Here’s what I get for bot-silence, for instance:

If they all look like that then I’m not sure why they seem down from UptimeRobot’s standpoint - they’re all up and running on Glitch’s end as far as I can tell. Maybe export the logs and see what the error messages are, or contact UptimeRobot’s support?

I reset stats and everything seems to work now.

1 Like

Hey guys,
I followed the steaps which were mentioned at the beginning, but it does not work and I didnt’t get any alerts per email