How to run a Python script around the clock without your own computer
The script is written and works: it collects prices from a site, sends a report to a chat, cleans up a spreadsheet once an hour. But it lives exactly as long as the terminal stays open. Close the laptop, let it sleep, lose Wi-Fi — and the collection stops, and you find out a week later from a gap in the data. The usual answer to this is to rent a server, install Python on it, set up autostart so the process comes back after a reboot, and keep an eye on system updates.
There is a shorter option: hand the script to a platform that keeps it running for you. Netrun takes your code, works out on its own that it is Python, installs the dependencies, starts the script and brings it back up if it crashes. Let us walk through it step by step, and be honest about where the free plan draws the line.
Make the script long-running, not one-shot
A script that does its job and exits is treated as finished — the platform will not launch it again every hour by itself. If the task repeats, the scheduler has to live inside the script: an endless loop with a pause between runs, or a scheduling library such as schedule or APScheduler. Then the process never exits and wakes itself up at the right time.
Collect dependencies in requirements.txt
Put a requirements.txt next to the script listing the libraries. From it we know this is Python and install everything needed during the build. Do not include the folder with installed packages — it only bloats the upload.
Move keys and passwords out of the code
Read tokens, API keys and database passwords from environment variables rather than from strings in the code. During project setup Netrun asks for these values and puts them into the environment encrypted — they will not sit in the archive or in the repository.
Upload the code and get a running process
Upload the folder as a ZIP archive or import a repository from GitHub, including a private one. Netrun installs the dependencies, starts the script and shows its output in your dashboard in real time. Everything you print or write to a log is visible there — it is a convenient way to check that runs happen on schedule.
Keep the free plan limit in mind
A script with no public link runs for three days on the free plan and then shuts down — a warning arrives a day in advance. Your code, settings and keys stay in place, nothing is deleted. Three days is enough to confirm that the script builds and runs on schedule. To keep it running permanently you need the Pro plan. The reason is simple: a website can fall asleep when idle and wake up when the link is opened, so it only occupies server space while it answers. A background script is busy all the time and there is nothing to wake it with — that continuous work is what you pay for on Pro.
Keeping a script running around the clock needs neither a laptop left on nor a rented server with autostart. Upload the code, move the keys into secrets and keep the scheduler inside the script — the platform handles the rest. Try Netrun.
Common questions
How do I run the script on a schedule, once an hour?
The schedule has to live inside the script: an endless loop with a pause, or a library such as schedule or APScheduler. The script never exits and wakes itself at the right moment. You do not need to set up a separate scheduler like cron on a server.
What happens if the script crashes?
Netrun restarts it automatically. The reason is visible in the logs in your dashboard: the script output is there in real time, so you can find the error and fix the code.
Can I keep a script running permanently on the free plan?
No. A script with no public link runs for three days on the free plan and then shuts down — the code and settings are kept. Permanent operation needs the Pro plan. What lives on Netrun for free with no time limit is websites: they sleep when idle and wake up when someone opens the link.
Where should I store the collected data?
The simplest option is to write to an external database or spreadsheet, so the data does not depend on the project. If you need a database next to the script, you can run one in the same project: up to five connected services, with data kept in permanent storage that survives code updates.
Do I need to set up systemd and autostart?
No. Keeping the process alive and restarting it is the platform’s job. There is no need to install Python on a server, write systemd units or watch for system updates.
Can I run a Python project — Django, Flask or FastAPI?
Yes. Put your dependencies in requirements.txt — Netrun detects Python and builds the project for you. Django, Flask and FastAPI are supported; the app should listen on the port from the environment variable, and keys and database access are set as secrets rather than in the code.
What happens if my app crashes?
We watch over projects and restart them if they fail. If something goes wrong, you can see the status and logs in your account and you get a notification.
Where can I see the logs and status of my project?
The project page shows the status, the logs and the event history — together they show what is happening with the project right now.