
You want a YouTube stream that stays live day and night, such as a lo-fi radio, a study stream, an ambience loop or a camera feed, without leaving your own PC on. Here is what YouTube allows, how to set it up on a VPS with FFmpeg or OBS, how to keep it running and what it costs.
Quick answer: Yes, you can stream 24/7 on YouTube. Its help pages set no maximum length for a live stream, but only streams under 12 hours are archived automatically, and a channel needs to be verified with no live streaming restrictions in the past 90 days. The simplest setup is a Linux VPS that loops your own media with FFmpeg to YouTube's RTMPS address, run as a systemd service so it starts again after a crash or reboot. Use OBS on a streaming VPS when you want scenes, overlays or browser sources. A 720p30 stream at 3 Mbps, YouTube's minimum for 720p, uses about 1 TB of transfer in 30 days.
No terminal, no OBS? If you only want your own videos or music to play around the clock on YouTube, our Playlist Hosting does the setup below for you: you upload your files, put them in order and go live from your browser, at 720p and 30 fps for €8.99 a month. The rest of this guide is for running the stream yourself on a VPS.
Can You Stream 24/7 on YouTube?
YouTube's rules that matter for a stream that never ends:
- Who can go live. "To live stream, you need to have no live streaming restrictions in the past 90 days and you need to verify your channel." You must be at least 16.
- Length. The help pages on archiving and DVR name no maximum length. They do limit what is kept: "If your live stream is less than 12 hours, YouTube can automatically archive it for you," and "If your stream exceeds 12 hours, it may not be captured at all." DVR, the pause and rewind feature, "may be limited or unavailable for streams longer than 12 hours". Our guide on how long a YouTube live stream can be covers the archive in detail.
- Copyright. "All live streams are scanned for matches to third-party content." When YouTube finds a match, a placeholder image may replace your stream and you are warned; if the content stays, the stream is interrupted or ended. Even licensed music can trigger this unless the rights holder adds your channel to their Content ID allowlist. Our copyright and DMCA guide covers music for streams.
- Money. A looped stream is reviewed like any other video for the Partner Program, and YouTube's monetization policies exclude content that feels templated or repetitive. Read YouTube's generic and repetitive content policy for 24/7 streams before you plan on ad income.
Why a VPS Instead of Your Own PC
Streaming from home works until something at home stops: a power cut, a router restart, a forced update or a PC that goes to sleep ends the stream, and the stream shares your home upload with everything else in the house. A PC left on around the clock also costs power (the sum is under What It Costs) and stays tied up. A VPS sends the stream from a data center connection, so your own PC can be off, and you manage it from any laptop or phone.
What You Need
- Media you have the rights to stream. Video files, music with a licence, or a camera feed you own.
- A server that stays on. A Linux VPS runs FFmpeg; a streaming VPS runs OBS in a desktop you open in your browser.
- Your stream URL and key. In YouTube Studio click Create, then Go live, to open the Live Control Room, and open the Stream tab. Copy the stream URL and the stream key. YouTube recommends RTMPS; OBS's built-in server list gives
rtmps://a.rtmps.youtube.com:443/live2as the primary address andrtmp://a.rtmp.youtube.com/live2as the legacy RTMP one. - A laptop or phone for the setup. You connect over SSH to a Linux VPS, or through the browser to a streaming VPS. After that the stream runs without it, and no capture card or home upload is involved.
Pick Your Route
| You want | Setup | Where it runs |
|---|---|---|
| A loop of one file or a playlist | FFmpeg as a systemd service (steps below) | A Linux VPS |
| Scenes, overlays, chat or browser sources | OBS Studio | A streaming VPS in your browser, or OBS on your own Linux VPS |
| No server work at all | A hosted 24/7 streaming tool | Compared in our 24/7 YouTube live stream tools guide |
FFmpeg needs no desktop and the least CPU; OBS is the tool once the picture has to change on its own, such as a clock or a timer that switches scenes. On a Linux VPS, which has no graphics card, OBS draws its interface, preview and scenes on the CPU as well, so the same stream needs a bigger plan with OBS than with FFmpeg.
How Big a VPS You Need
YouTube lists a minimum and a recommended H.264 bitrate per resolution: 3 and 8 Mbps for 720p at 30 or 60 fps, 5 and 14 Mbps for 1080p30, and 6 and 17 Mbps for 1080p60. Encoding costs CPU, the bitrate costs transfer.
| Output | Bitrate in the examples | Starting point for x264 veryfast |
|---|---|---|
| 720p30 | 3,000 kbps | 3 vCores, 4 GB RAM |
| 1080p30 | 5,000 kbps | 4 vCores, 8 GB RAM |
| 1080p60 | 6,000 kbps | 6 vCores, 8 GB RAM or more |
These are starting points, not measurements; the test in step 3 shows whether your server keeps up with your file.
Step 1: Prepare the VPS (Ubuntu 24.04 or Debian 12)
Install FFmpeg and give the stream its own account:
sudo apt update && sudo apt install -y ffmpeg
sudo useradd --create-home --shell /usr/sbin/nologin streamer
sudo mkdir -p /home/streamer/media
Upload your files from your own computer, then hand them to that account:
scp lofi-source.mp4 root@YOUR_VPS_IP:/home/streamer/media/
ssh root@YOUR_VPS_IP 'chown -R streamer: /home/streamer/media'
The stream only sends data out, so the server needs no open ports besides SSH. With ufw, allow SSH first and then turn the firewall on: sudo ufw allow 22, then sudo ufw enable.
Step 2: Prepare the File Once (Optional, Saves CPU)
If you encode the loop once in the format YouTube wants, the live stream can send it without encoding it again:
sudo -u streamer ffmpeg -i /home/streamer/media/lofi-source.mp4 -vf scale=-2:720 -r 30 \
-c:v libx264 -preset slow -b:v 3000k -maxrate 3000k -bufsize 6000k -g 60 -pix_fmt yuv420p \
-c:a aac -b:a 128k -ar 44100 -ac 2 /home/streamer/media/lofi-loop.mp4
What the settings do: scale=-2:720 makes the picture 720 pixels high and keeps the aspect ratio, -r 30 fixes the frame rate at 30, so -g 60 puts a keyframe every 2 seconds (YouTube recommends 2 and says not to exceed 4). -maxrate with -bufsize keeps the bitrate close to the 3,000 kbps target, since YouTube asks for constant bitrate. Audio is AAC at 128 kbps and 44.1 kHz stereo, YouTube's recommendation for stereo.
Step 3: Test by Hand
Run the stream in your SSH session for ten minutes. With a prepared file, -c copy passes it through:
sudo -u streamer ffmpeg -re -stream_loop -1 -i /home/streamer/media/lofi-loop.mp4 \
-c copy -f flv "rtmps://a.rtmps.youtube.com:443/live2/YOUR_STREAM_KEY"
With any other file, encode it live instead by replacing -c copy with the settings from step 2, using -preset veryfast. -re reads the input at its own frame rate, as a live stream needs, and -stream_loop -1 loops it forever.
The preview should appear in YouTube's Live Control Room within a minute, and the speed= value at the end of FFmpeg's status line should stay at about 1x. If it drops below 1x, or top shows the CPU at 100%, use a faster preset, a lower resolution or a bigger plan. Let one full loop pass to see the jump from the end of the file to the start, then stop with Ctrl+C. If FFmpeg says the rtmps protocol is not found, use the legacy rtmp://a.rtmp.youtube.com/live2 address.
Step 4: Run It as a Service
Put the settings in a file only root can read:
sudo tee /etc/yt-stream.env >/dev/null <<'EOF'
VIDEO=/home/streamer/media/lofi-loop.mp4
YT_URL=rtmps://a.rtmps.youtube.com:443/live2
YT_KEY=your-stream-key
EOF
sudo chmod 600 /etc/yt-stream.env
Save the stream command as /usr/local/bin/yt-stream and make it executable with sudo chmod 755 /usr/local/bin/yt-stream:
#!/bin/bash
# Started by systemd, which reads VIDEO, YT_URL and YT_KEY from /etc/yt-stream.env.
# exec replaces this shell with FFmpeg, so systemd watches FFmpeg itself.
exec ffmpeg -nostats -loglevel level+warning -re -stream_loop -1 -i "$VIDEO" \
-c copy -f flv "$YT_URL/$YT_KEY"
Then the unit, /etc/systemd/system/yt-stream.service:
[Unit]
Description=24/7 YouTube stream
Wants=network-online.target
After=network-online.target
[Service]
User=streamer
EnvironmentFile=/etc/yt-stream.env
ExecStart=/usr/local/bin/yt-stream
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now yt-stream
systemctl status yt-stream
journalctl -u yt-stream -f
Restart=always starts FFmpeg again 10 seconds after it exits for any reason, and enable starts it at boot once the network is up. -nostats drops the progress line and -loglevel level+warning keeps only warnings and errors, so the journal stays readable. The env file keeps the key out of the unit, but FFmpeg still receives it on its command line, which other accounts on the server can see; our stream key guide explains how to deal with that.
Step 5: Stream a Playlist Instead of One File
FFmpeg's concat demuxer plays a list of files one after the other. Make every file the same resolution, frame rate and audio format first (step 2 does that), because "All files must have the same streams". Write the list with absolute paths:
for f in /home/streamer/media/*.mp4; do echo "file '$f'"; done | shuf | sudo -u streamer tee /home/streamer/media/playlist.txt
Keep quotes out of your file names, then change the input in /usr/local/bin/yt-stream to:
exec ffmpeg -nostats -loglevel level+warning -re -stream_loop -1 -f concat -safe 0 -i /home/streamer/media/playlist.txt \
-c copy -f flv "$YT_URL/$YT_KEY"
-safe 0 is needed because the concat demuxer rejects absolute paths by default. After you change the list, restart the service at a quiet hour (sudo systemctl restart yt-stream) so FFmpeg opens the new one, and test the switch between two files by hand first. A crossfade between two tracks needs FFmpeg's acrossfade filter and a new encode; our lo-fi radio setup guide shows the filter. Schedules by time of day are in our automated news or music channel guide.
A logo on top of the picture needs a live encode. In /usr/local/bin/yt-stream, replace -c copy with these lines, so the image becomes a second input and the picture is encoded again:
-i /home/streamer/media/logo.png -filter_complex "overlay=W-w-20:20" \
-c:v libx264 -preset veryfast -b:v 3000k -maxrate 3000k -bufsize 6000k -g 60 -pix_fmt yuv420p \
-c:a aac -b:a 128k -ar 44100 -ac 2
A short clip that loops under a separate music file needs a live encode too. Add AUDIO=/home/streamer/media/music.mp3 to /etc/yt-stream.env and use this command in /usr/local/bin/yt-stream:
exec ffmpeg -nostats -loglevel level+warning \
-re -stream_loop -1 -i "$VIDEO" -re -stream_loop -1 -i "$AUDIO" \
-map 0:v:0 -map 1:a:0 \
-c:v libx264 -preset veryfast -b:v 3000k -maxrate 3000k -bufsize 6000k -g 60 -pix_fmt yuv420p \
-c:a aac -b:a 128k -ar 44100 -ac 2 -f flv "$YT_URL/$YT_KEY"
-map 0:v:0 -map 1:a:0 takes the picture from the clip and the sound from the music file, so a clip with its own audio track does not play over the music. Each input loops on its own, so the clip and the music do not need the same length. -g 60 assumes a 30 fps clip; use twice your frame rate.
The OBS Route
OBS fits a stream with scenes: a looping background in a Media Source or VLC Video Source playlist, music, a clock or now playing text, and a fallback scene for maintenance. In Settings, Stream, choose the YouTube RTMPS service and paste your key; in Output, set Output Mode to Advanced, the encoder to x264, Rate Control to CBR, Keyframe Interval to 2 s and the CPU Usage Preset to veryfast. Our OBS settings for 24/7 streaming lists bitrates per platform.
Under Settings, Advanced, Automatically Reconnect is on by default with a Retry Delay of 2 seconds and Maximum Retries of 25, after which OBS stops trying (OBS auto reconnect guide). The --startstreaming launch parameter starts the stream as soon as OBS opens, for example after a reboot. For OBS on your own Linux VPS, see our 24/7 OBS streaming VPS guide and cloud OBS setup guide.
Moving a stream from your PC: use Scene Collection, Export Scene Collection and Profile, Export Profile, copy the media files, import both on the server, point sources at the new file paths, and test with an unlisted stream before you switch the public one.
Keep It Running
- Restarts. systemd or OBS's reconnect brings the stream back after a crash or a dropped connection, after a short gap.
- The archive. Because streams over 12 hours may not be archived, end and restart the broadcast before 12 hours if you want each part kept as a video, or record your own copy; YouTube itself recommends "recording a local archive as a backup".
- Monitoring. A running FFmpeg process does not prove the stream is live on YouTube. Our guide on how to monitor a 24/7 live stream adds a byte check at the ingest, a check through YouTube's API and a heartbeat from outside the VPS, with alerts on Discord or by email.
- A daily look. Open the stream as a viewer once a day: a stream can be live with a frozen picture or silence. The Live Control Room's stream health messages show what YouTube sees.
Also Streaming to Twitch or Kick
Run a second copy of the service with that platform's URL and key, so each platform has its own connection and restarts on its own. Each copy sends the full bitrate again: at 6,000 kbps with 128 kbps audio, one platform uses about 2 TB of transfer in 30 days and three platforms about 6 TB. Twitch says "The maximum broadcast length is 48 hours. This cannot be changed," so check after the first 48 hours that systemd brought the channel back live. Kick takes H.264 (x264) with CBR only, at most 8,000 kbps, 1920x1080 and 60 fps, and shows your stream URL under Channel, Stream URL and Key. To send one upload from home to several platforms, use a VPS as an RTMP relay.
What It Costs
A stream sends its bitrate around the clock. In decimal units for 30 days, with 128 kbps audio added:
| Video bitrate | Per day | Per 30 days |
|---|---|---|
| 3,000 kbps (YouTube's 720p minimum) | 33.8 GB | 1,013 GB |
| 5,000 kbps (1080p30 minimum) | 55.4 GB | 1,661 GB |
| 6,000 kbps (1080p60 minimum) | 66.2 GB | 1,985 GB |
| 8,000 kbps (720p recommended) | 87.8 GB | 2,633 GB |
These are sums (kbps × 1,000 × 86,400 ÷ 8), not measurements. A prepared 720p file at 3,128 kbps takes about 1.4 GB of disk per hour of video. Our 24/7 stream bandwidth guide adds YouTube's recommended bitrates, several platforms at once, radio listeners and how many streams fit each plan.
At home the power bill is the running cost: a PC drawing 150 W around the clock uses 150 W × 24 h × 30 days = 108 kWh a month, €27.00 at an example rate of €0.25 per kWh. Put your own PC's draw and rate into the same sum.
Space-Node's VPS hosting runs in an EU data center. As of 8 November 2026, the Standard VPS-S (3 vCores, 4 GB RAM, 60 GB NVMe, 10 TB transfer a month) costs €4.99 a month and the VPS-M (4 vCores, 8 GB RAM, 80 GB NVMe, 10 TB) €8.99, enough transfer for every row above. To work in OBS instead of a terminal, our streaming VPS opens as a desktop in your browser, and every plan lists OBS in its features (pre-installed on Stone, setup help or a custom configuration on larger plans). Stone (€9.99) is listed at 480p and 1 fps, for tests; Gold (€19.99) does 720p30 and Platinum (€29.99) 1080p30 or 720p60, encoded on the CPU.
Troubleshooting
- Nothing appears in Live Control Room. Check the stream key and URL;
journalctl -u yt-stream -n 50shows FFmpeg's error. - The stream stops every few minutes. Read the journal around the restart lines. Common causes are a corrupt file (re-encode it with step 2), a server out of memory, or a bitrate the CPU cannot encode in real time.
- speed= stays below 1x. Use a prepared file with
-c copy, a faster preset such assuperfast, or a lower resolution. - A jump at the loop point. Prepare the file with step 2 and test a few loops by hand.
- OBS gets slower over days. Browser sources can grow in memory; keep scenes simple and restart OBS at a quiet hour.
FAQ
Can you stream 24/7 on YouTube?
Yes. YouTube's help pages set no maximum length; past 12 hours you lose the automatic archive and, partly, DVR. Your channel must be verified with no live streaming restrictions in the past 90 days.
How do I do a 24/7 live stream on YouTube without a PC?
Rent a VPS, upload your media and run FFmpeg as a systemd service that loops it to YouTube's stream URL with your key (steps 1 to 4), or run OBS on a streaming VPS for scenes. A laptop or phone is needed only for the setup.
Is there a free way to run a 24/7 YouTube stream?
YouTube charges nothing for live streaming. The cost is the machine: your own PC costs power and depends on your home upload, while hosted tools and VPS plans cost a monthly fee. Our tools comparison lists what the hosted options include.
What bitrate should a 24/7 YouTube stream use?
At least YouTube's minimum: 3 Mbps for 720p, 5 Mbps for 1080p30 and 6 Mbps for 1080p60, with 8, 14 and 17 Mbps as its recommendations. More bitrate costs more CPU and transfer, so pick the lowest that looks right for your content.
Do I need a GPU for a 24/7 stream?
No. FFmpeg and OBS encode with x264 on the CPU, and with a prepared file and -c copy the stream needs almost no encoding at all.
Do watch hours from a 24/7 stream count for the YouTube Partner Program?
Only if the stream ends up as a public video. YouTube's eligibility page says watch hours from "Livestreams that are unlisted, deleted, or not converted to VOD" do not count, and a stream over 12 hours may not be archived. Our monetization guide for 24/7 streams covers the other income options.
Sources
All opened on 8 November 2026:
- YouTube Help: Get started with live streaming, Create a live stream with an encoder, Choose live encoder settings, bitrates, and resolutions, Archive live streams, Turn on DVR on live streams, Copyright issues with live streams, YouTube channel monetization policies, YouTube Partner Program overview and eligibility
- OBS Studio: built-in server list, services.json, launch parameters, reconnect defaults in OBSBasic.cpp, menu labels in en-US.ini, settings layout
- FFmpeg: ffmpeg documentation (-re, -stream_loop, -r, -nostats, -loglevel), formats (concat demuxer, safe), codecs (b, maxrate, bufsize, g, preset), filters (scale, overlay), ffmpeg package for Ubuntu 24.04
- systemd: systemd.service (Restart, RestartSec), systemd.exec (EnvironmentFile), systemd.special (network-online.target)
- Ubuntu Server docs: ufw firewall
- Twitch: Broadcasting Guidelines
- Kick Help Center: OBS or Streamlabs not connecting to KICK
- Space-Node: VPS plan files and the streaming VPS page for plans, prices and features