To install FFmpeg on a Contabo VPS running Ubuntu, connect over SSH, refresh apt’s package metadata, and install the package from Ubuntu’s repositories. Then run ffmpeg -version to confirm the executable is available; the package version depends on your Ubuntu release and updates.
That gets the software installed, not the stream configured. YouTube supplies the ingestion address and stream key for a particular stream, and an RTMPS connection also needs the secure endpoint, port 443 and the correct TLS hostname. The steps below separate those tasks so you can check each before leaving a channel unattended.
Check your Ubuntu release and SSH access
Contabo is the VPS host; Ubuntu is the operating system whose repositories determine which FFmpeg package apt installs. Before following any package-version advice, check which Ubuntu release is on the machine. Do not assume that a new VPS uses the same release as another VPS, or that an article written for one release applies unchanged to yours.
Connect using the VPS address and an account with permission to use sudo. For example, from a terminal on your own computer, the connection usually has this form:
ssh YOUR_USERNAME@YOUR_VPS_ADDRESS
Replace both capitalised placeholders with the username and address supplied for your VPS. If SSH uses a non-default port or a private key, follow the access details configured for that machine. Do not paste private keys or passwords into a public guide, shell transcript or support post.
Once connected, check the release with either of these commands:
lsb_release -a
cat /etc/os-release
The first command may not be present on a minimal installation; /etc/os-release is a useful fallback. Note the Ubuntu release name and version. If you need to investigate an exact package build later, also note the machine’s architecture and the version apt reports, since repository updates can change the build available to a system.
A successful SSH login only confirms that you can reach a shell. It does not establish that the machine has enough CPU capacity or network headroom for your intended encode. The reviewed sources do not establish which Contabo plan can sustain a particular resolution, bitrate or continuous workload. Check the current plan specifications and test with the actual media and settings you intend to use.
Refresh apt package metadata
Apt uses local package metadata to learn which packages are available from the enabled repositories. Refresh it before installation:
sudo apt update
Enter your account password if prompted. Linux may not display characters as you type; that is normal. Watch the output for repository errors rather than treating the appearance of a prompt as proof that everything updated. If apt reports unreachable repositories, expired metadata or signing problems, resolve that first using your Ubuntu release’s normal repository configuration.
This command refreshes metadata; it does not install FFmpeg. Keeping those steps distinct makes it easier to see whether a failure is about package discovery or installation. It also avoids guessing at a version number copied from another Ubuntu machine.
Install FFmpeg from Ubuntu repositories
Install the distribution package with:
sudo apt install ffmpeg
Read apt’s proposed changes before confirming. The package is listed in Ubuntu’s Universe component, so if apt says it cannot locate ffmpeg, first confirm the release and whether the usual Ubuntu repositories, including Universe, are enabled. Do not start by adding an arbitrary personal package archive. An unfamiliar archive changes the software source you trust and may introduce a build that is not maintained as part of the standard Ubuntu package set.
Ubuntu’s package index lists FFmpeg for both Ubuntu 22.04 LTS and Ubuntu 24.04 LTS, but not at one universal version. For example, the index data retrieved in 2026 showed 7:4.4.2-0ubuntu0.22.04.1 for Jammy and 7:6.1.1-3ubuntu5 for Noble. These are examples tied to those releases and that retrieved package data, not promises about what every architecture or updated system will install today. Check Ubuntu’s FFmpeg package listings for current release-specific information.
If you want to see what apt will install before accepting, you can ask it to show package policy:
apt-cache policy ffmpeg
The candidate version shown there is the version your configured repositories currently offer. It is more relevant to your machine than a version quoted for a different release. If no candidate appears, return to the release and repository checks rather than assuming that the package is unavailable on Ubuntu altogether.
Installing through apt is a straightforward fit when you want Ubuntu to manage the package in the ordinary way. If you need a particular newer build or compile-time feature, that is a separate decision: check the official FFmpeg download page and understand how you will maintain and update that build. A custom build is not an automatic improvement for a simple file-to-YouTube stream.
Verify the executable and inspect the build
After apt finishes, run:
ffmpeg -version
A working installation prints a version line and build configuration details. This is a simple executable check: it confirms the shell can find FFmpeg and that the program starts. It does not confirm that a specific media file will decode, that the build contains every encoder or protocol you need, that the VPS can encode your chosen settings, or that YouTube will accept a stream.
Look at the configuration details if your command later reports an unknown encoder or protocol. The Ubuntu FFmpeg manual documents command options, but remember that manuals can describe options beyond the capabilities of a particular installed build. Your local ffmpeg -version output and a small test with the intended input are the practical checks.
You can also ask FFmpeg to list available encoders or protocols, though the output is long:
ffmpeg -encoders
ffmpeg -protocols
For the example below, check for the H.264 encoder named libx264 and support for the protocols required by the destination. Availability varies with how a build was compiled. Do not assume that installing the package alone proves these capabilities.
If your goal is a looping channel rather than a one-off broadcast, the software check is only one stage in a larger setup. A guide to building a devotional stream with Docker and FFmpeg covers a different way to package a repeatable workflow. For an audio-bearing playlist, also consider the distinct failure described in YouTube reporting missing audio from an FFmpeg loop.
Find the ingestion address and stream key
Open YouTube Studio and use the settings for the specific live stream you intend to start. YouTube’s LiveStreams API documentation describes ingestion information, including the address and stream name associated with a stream. In Studio, copy the current values presented for that stream rather than borrowing an endpoint or key from an example on the web.
Some encoders ask for a server URL and stream key in separate fields. Others take a combined destination in the form STREAM_URL/STREAM_NAME. FFmpeg commands generally use a single output URL, so you need to understand whether the value YouTube presents is a base URL, a stream name, or a combined address before assembling the destination. The layout and values are specific to the active stream; there is no safe generic key to include in an article.
Treat the stream key as a credential. Anyone who obtains it may be able to send video to your broadcast. Keep it out of screenshots, public scripts, shared shell history and support messages. If a key is exposed, use YouTube Studio’s controls to replace it and update the encoder configuration. Avoid printing complete output URLs in logs that other people can read, because the key may be part of the URL.
Before sending anything, confirm that the chosen stream is configured and ready in YouTube Studio. An encoder can connect to an ingest service while the event itself is not in the state you expect. If the channel, event, privacy setting or stream configuration is wrong, FFmpeg cannot correct that from the VPS.
For conventional low-latency streaming, YouTube documents RTMP and RTMPS as options for H.264 contribution. RTMPS adds encryption for the feed in transit. HLS and DASH are different delivery approaches with different codec, latency and setup characteristics; do not substitute an HLS or DASH address into a basic FLV/RTMP command and expect it to work unchanged. See YouTube’s ingestion protocol comparison when deciding whether your workflow needs an alternative.
Configure the RTMPS endpoint, port and TLS
Use the secure ingestion values YouTube supplies for the active stream. The destination must use the rtmps scheme, not merely a setting labelled “secure” beside a plain rtmp URL. YouTube’s RTMPS ingestion guide specifies a TLS connection to the ingestion server on port 443 and requires the server hostname for authentication through TLS Server Name Indication (SNI).
That last detail matters because TLS authenticates a hostname, not just a numeric IP address. A client that connects to the wrong hostname, or does not send the expected hostname in SNI, may fail even if the destination appears otherwise reachable. A cleartext RTMP connection aimed at an RTMPS endpoint can also time out. When diagnosing a connection failure, check scheme, hostname, port and TLS behaviour together rather than changing bitrate first.
Use this command only as a starting template, not as a tested Contabo command or a ready-made destination:
ffmpeg -re -i INPUT_FILE \
-c:v libx264 -preset veryfast -b:v VIDEO_BITRATE \
-c:a aac -b:a AUDIO_BITRATE \
-f flv 'rtmps://YOUTUBE_INGEST_HOST/YOUTUBE_APP/YOUR_STREAM_KEY'
Replace every capitalised placeholder with values appropriate to your input and the active YouTube stream. The host, application path and key must come from YouTube’s current stream-specific details; do not copy those placeholder words literally. The video and audio bitrate placeholders also need values selected for the source, desired output and YouTube’s current recommendations. This guide does not prescribe a bitrate or claim a VPS plan can encode it.
The example uses -re to read a file at its natural playback rate, and -f flv for the RTMP-family output format. It requests H.264 via libx264 and AAC audio. If your input has no audio, or if its codecs and stream layout differ, the command may need to change. If FFmpeg reports that libx264 is unavailable, review the build capabilities rather than assuming that the command syntax is universally valid.
Do not switch the scheme to rtmp while keeping an RTMPS endpoint and port. The transport must negotiate TLS to the hostname YouTube specifies, including SNI. A firewall or network policy on the VPS can also affect connectivity to the destination port, so check the machine’s applicable network rules if DNS and command configuration look correct but the connection does not complete.
Send a test stream and verify it
Start with a short, non-critical test using a representative file. Keep the terminal output visible and check for errors about input decoding, missing encoders, TLS connection or rejected publishing. An FFmpeg process that remains active is not by itself proof that viewers can see the intended picture and sound. Check the stream preview and health indicators in YouTube Studio as well.
During the test, verify that video is moving, audio is present when expected, and the stream is associated with the correct event. If Studio reports a problem, use that message alongside FFmpeg’s output; each side observes a different part of the chain. A quiet or frozen image can arise from the source file, encoding settings, a malformed destination, stream readiness or connectivity. Change one relevant thing at a time so you can tell which check helped.
Once the short test works, consider the operating model for an always-on channel. A process started in an SSH session on your own computer depends on the VPS process continuing to run and on you being able to observe failures. If your computer is switched off, the VPS can still keep running, but you remain responsible for process management, monitoring, restarts, file access and updates. Read how a 24/7 stream behaves when your computer is turned off before treating an SSH launch as a complete unattended plan.
If the recurring burden is keeping a file-based broadcast alive while your own computer is off, StreamNeo removes that particular task: you upload the video once, provide the YouTube stream key, and the broadcast runs without your computer staying on, with monitoring and automatic restarts if it drops. It is YouTube-only, and it does not decide your stream’s rights, event settings, content suitability or the capacity of any separate VPS you choose to operate.
For an FFmpeg-on-VPS setup, test against the actual file and expected duration, watch for resource pressure, and decide how you will restart and inspect the process if it exits. Do not infer 24/7 suitability from a successful short test alone. If audio and video drift over a longer playlist, investigate the source timestamps and synchronization separately; this audio/video sync troubleshooting guide addresses that kind of symptom.
Before committing, compare the operating options on the pricing page. When the file and channel are ready, start free — 24-hour trial, no card.
FAQ
How do I install FFmpeg on my Ubuntu VPS and stream to YouTube Live?
Connect over SSH, run sudo apt update and sudo apt install ffmpeg, then verify with ffmpeg -version. For streaming, copy the ingestion information for the active event from YouTube Studio and configure an RTMPS destination with its correct hostname, path, port and TLS behaviour. Installation is only one part of the setup; test the input, build capabilities and stream in Studio.
Will Ubuntu 22.04 and 24.04 install the same FFmpeg version?
No. Ubuntu publishes release-specific package builds, and repository updates can change what apt offers over time. Check apt-cache policy ffmpeg on your VPS and consult the current Ubuntu package index rather than assuming a version listed for another release applies to your machine.
Can I use any YouTube stream key or RTMP address?
No. Use the address and key assigned to the particular stream you are setting up. Keep the key private, and check that the destination uses the current secure RTMPS details when you intend to stream over TLS.
Does installing FFmpeg mean my VPS can run a 24/7 stream?
It means the program is installed and can be launched; it does not establish that your chosen encode will fit the VPS or that the process will remain healthy. Test with your real media and settings, check current provider specifications, and arrange a way to observe and recover the process before relying on it unattended.