how to run python script 24/7 and best site?

Oldwizard

Regular Member
Joined
Nov 25, 2011
Messages
228
Reaction score
126
hey guys, i have 8 scripts that i need to run all day for 2 months. which service is best according to you?

pythonanywhere says 1 web app, that means 1 script?

or digitalocean would do my job?

thanks
 
Depends on the script, but a small VPS will eventually do the job
 
Depends on the script, but a small VPS will eventually do the job
scripts are very simple. just posting on some insta profiles 24/7.

which vps you recommend? or a cloud service is good like replit and all
 
Literally any, whatever suites your budget or know how to set it up, just go with it
 
Literally any, whatever suites your budget or know how to set it up, just go with it
I have a 2-core VPS, and I set up vs code on it, turned off automatic updates, and have my script running. I won't be having any problems right?
or what measures do you suggest to stop my scripts from stopping?
 
The easiest way is to dockerize the scripts, and run them with docker compose. Have a “restart: always” or “restart: unless-stopped” property in the docker compose for each container so that they come back up when the script has done executing. If you do it this way, you also don’t have to worry about python version and virtual environments, as they are all virtualised.


As for hardware you could get a cheap vps, or even a raspberry pi 4.
 
Good luck finding one at face price
Yeah at this point of time, raspberry pi stock has become a internet meme lol. Luckily I bought 2 (pi 4b)when the stocks used to be available.


Perhaps keep watching the stocks and grab one as soon as they become available.
 
I have a 2-core VPS, and I set up vs code on it, turned off automatic updates, and have my script running. I won't be having any problems right?
or what measures do you suggest to stop my scripts from stopping?
Most of the resources are shared in VPS so if your scripts consume more resources than permitted by the provider there are chances of it getting suspended or terminated. Check how much CPU/ disk read/writes/bandwidth etc are used when the scripts run.
 
Odroid is also bulk cheap for its computing power.
I got a few n2ls that runs python and node servers.
That 4gb monster is twice as cheap and has more computing power than rasp 4.
 
Get a VPS as per your requirements.
Install ubuntu and then install cloudpanel.
Once you have setup everything properly you can logi into cloudpanel it will have an option to create site with options to create different types of websites.
The last option is python site which you can use to create your python site.
Cloudpanel also has cron option maybe if you need it.

Refer for more details: https://www.cloudpanel.io/docs/v2/getting-started/
Add a required python version: https://www.cloudpanel.io/docs/v2/python/guides/adding-a-python-version/

You can always get a decent FREE VPS from oracle cloud provided you have a mobile number and a CC for registration there.
There are tuts available on YouTube regarding all this.

I have been using oracle cloud VPS with cloudpanel for multiple sites wordpress, php, node with cloudflare free CDN and it works great.

Remember to backup your site because you never know when the freebie might end, although it's advertised as lifetime.
 
Get a VPS as per your requirements.
Install ubuntu and then install cloudpanel.
Once you have setup everything properly you can logi into cloudpanel it will have an option to create site with options to create different types of websites.
The last option is python site which you can use to create your python site.
Cloudpanel also has cron option maybe if you need it.

Refer for more details: https://www.cloudpanel.io/docs/v2/getting-started/
Add a required python version: https://www.cloudpanel.io/docs/v2/python/guides/adding-a-python-version/

You can always get a decent FREE VPS from oracle cloud provided you have a mobile number and a CC for registration there.
There are tuts available on YouTube regarding all this.

I have been using oracle cloud VPS with cloudpanel for multiple sites wordpress, php, node with cloudflare free CDN and it works great.

Remember to backup your site because you never know when the freebie might end, although it's advertised as lifetime.
Oracle is known to be a douche to terminate free accounts with no rhyme or reason so there is that.
 
Back
Top