{"id":86421,"date":"2022-09-11T08:34:10","date_gmt":"2022-09-11T08:34:10","guid":{"rendered":"https:\/\/ded9.com\/?p=86421"},"modified":"2025-11-19T13:54:59","modified_gmt":"2025-11-19T13:54:59","slug":"how-to-make-a-streaming-server-with-obs-and-ubuntu","status":"publish","type":"post","link":"https:\/\/ded9.com\/de\/how-to-make-a-streaming-server-with-obs-and-ubuntu\/","title":{"rendered":"How to Create a Streaming Server with OBS on Ubuntu"},"content":{"rendered":"<p>Streaming has become an essential part of content creation, whether for gaming, online courses, or live events. Open Broadcaster Software (OBS) is a widely used open-source tool for high-quality streaming. This guide will walk you through setting up a streaming server using OBS on Ubuntu, along with important optimizations for a stable stream.<\/p>\n<h2>Prerequisites<\/h2>\n<p>Before you begin, ensure you have:<\/p>\n<ul>\n<li><strong>A server running Ubuntu 20.04 or later<\/strong> with at least:\n<ul>\n<li><strong>2 vCPUs<\/strong><\/li>\n<li><strong>4GB RAM<\/strong><\/li>\n<li><strong>Stable internet connection<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>OBS is installed on your local machine (Windows\/Linux\/Mac) or directly on the Ubuntu server<\/li>\n<li>Basic knowledge of Linux commands<\/li>\n<li>An RTMP server for hosting your stream (Nginx RTMP or an external service like YouTube or Twitch)<\/li>\n<\/ul>\n<h2>Step 1: Install OBS on <a href=\"https:\/\/ded9.com\/what-is-lubuntu-os\/\">Ubuntu<\/a><\/h2>\n<p>OBS requires certain dependencies before installation. Run the following commands:<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:false,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">sudo apt update &amp;&amp; sudo apt upgrade -y\r\nsudo apt install ffmpeg v4l2loopback-dkms<\/pre>\n<\/div>\n<pre>\u00a0To install OBS:<\/pre>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:false,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">sudo add-apt-repository ppa:obsproject\/obs-studio\r\nsudo apt update\r\nsudo apt install obs-studio<\/pre>\n<\/div>\n<h2>Step 2: Setting Up an RTMP Server on Ubuntu<\/h2>\n<p>Instead of streaming directly to platforms like YouTube, you can set up your own RTMP server for private broadcasting.<\/p>\n<h3>Install <a href=\"https:\/\/nginx.org\/en\/\" target=\"_blank\" rel=\"noopener\">Nginx<\/a> with RTMP Module<\/h3>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:false,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">sudo apt install nginx libnginx-mod-rtmp -y<\/pre>\n<\/div>\n<h3>Configure RTMP<\/h3>\n<p>Edit the Nginx configuration file:<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:false,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">sudo nano \/etc\/nginx\/nginx.conf<\/pre>\n<\/div>\n<p>Add the following lines at the end:<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:false,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">rtmp {\r\n    server {\r\n        listen 1935;\r\n        chunk_size 4096;\r\n\r\n        application live {\r\n            live on;\r\n            record off;\r\n        }\r\n    }\r\n}<\/pre>\n<\/div>\n<p>Save and exit (<code>CTRL+X<\/code>, then <code>Y<\/code>, then <code>Enter<\/code>). Restart Nginx:<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:false,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">sudo systemctl restart nginx<\/pre>\n<\/div>\n<p>Your RTMP server is now ready at <code>rtmp:\/\/your-server-ip\/live<\/code>.<\/p>\n<h2>Step 3: Configure OBS<\/h2>\n<p>Open OBS and follow these steps:<\/p>\n<ol>\n<li>Navigate to <strong>Settings &gt; Stream<\/strong>.<\/li>\n<li>Select <strong>Custom Streaming Server<\/strong>.<\/li>\n<li>Enter the RTMP URL: <code>rtmp:\/\/your-server-ip\/live<\/code>.<\/li>\n<li>Set a <strong>Stream Key<\/strong> (e.g., <code>teststream<\/code>).<\/li>\n<li>Click <strong>Apply<\/strong> and <strong>OK<\/strong>.<\/li>\n<\/ol>\n<h2>Step 4: Optimize OBS Settings<\/h2>\n<p>To ensure smooth streaming, adjust the following settings:<\/p>\n<table>\n<thead>\n<tr>\n<th>Resolution<\/th>\n<th>Frame Rate<\/th>\n<th>Bitrate (Kbps)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1920&#215;1080<\/td>\n<td>60fps<\/td>\n<td>6000-9000<\/td>\n<\/tr>\n<tr>\n<td>1280&#215;720<\/td>\n<td>60fps<\/td>\n<td>4500-6000<\/td>\n<\/tr>\n<tr>\n<td>1280&#215;720<\/td>\n<td>30fps<\/td>\n<td>3000-4500<\/td>\n<\/tr>\n<tr>\n<td>854&#215;480<\/td>\n<td>30fps<\/td>\n<td>1000-2000<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In <strong>Output Settings<\/strong>:<\/p>\n<ul>\n<li>Set <strong>Encoder<\/strong> to <code>x264<\/code> (or <code>NVENC<\/code> If using an NVIDIA GPU.<\/li>\n<li>Set <strong>Keyframe Interval<\/strong> to <code>2<\/code>.<\/li>\n<li>Choose <strong>CBR (Constant Bitrate)<\/strong>.<\/li>\n<\/ul>\n<p>In <strong>Advanced Settings<\/strong>:<\/p>\n<ul>\n<li>Enable <strong>Network Optimizations<\/strong> for smoother connectivity.<\/li>\n<\/ul>\n<h2>Step 5: Start Streaming<\/h2>\n<ol>\n<li>Click <strong>Start Streaming<\/strong> in OBS.<\/li>\n<li>Open VLC or another media player.<\/li>\n<li>Enter the RTMP URL: <code>rtmp:\/\/your-server-ip\/live\/teststream<\/code>.<\/li>\n<li>You should see your live stream in action.<\/li>\n<\/ol>\n<h2>Additional Optimizations<\/h2>\n<ul>\n<li><strong>Use a Wired Connection<\/strong>: Avoid Wi-Fi for stable streaming.<\/li>\n<li><strong>Monitor CPU Usage<\/strong>: Use <code>htop<\/code> to ensure OBS isn\u2019t overloading the server.<\/li>\n<li><strong>Automate OBS Startup<\/strong>: Use <code>screen<\/code> or <code>systemd<\/code> to run OBS as a background process.<\/li>\n<li><strong>Enable Recording<\/strong>: Save streams locally for backup.<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>By following this guide, you can successfully set up a streaming server with OBS on Ubuntu. Whether you\u2019re streaming to a private audience or a large platform, these configurations will help you achieve a stable and high-quality stream.<\/p>\n<h2>FAQ<\/h2>\n<div id=\"rank-math-rich-snippet-wrapper\"><div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-1\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">What is RTMP and why do I need it for streaming?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>RTMP (Real Time Messaging Protocol) is a protocol for live video streaming. By running your own RTMP server (via Nginx), you can host and control your live stream privately.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-2\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">Can I use this setup for public streaming (e.g., YouTube)?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Yes \u2014 you can stream from OBS to your self-hosted RTMP server, and then re-stream the output to external platforms if needed.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-3\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \">Do I need a GPU to run OBS on an Ubuntu server?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>While OBS can run on CPU, using a GPU (or hardware encoder like NVENC) improves performance significantly, especially for high-resolution streams.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Streaming has become an essential part of content creation, whether for gaming, online courses, or live events. Open Broadcaster Software (OBS) is a widely used open-source tool for high-quality streaming. This guide will walk you through setting up a streaming server using OBS on Ubuntu, along with important optimizations for a stable stream. Prerequisites Before [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":86445,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[86],"tags":[5026,934,961],"class_list":["post-86421","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-obs","tag-server","tag-ubuntu"],"acf":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/posts\/86421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/comments?post=86421"}],"version-history":[{"count":3,"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/posts\/86421\/revisions"}],"predecessor-version":[{"id":265539,"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/posts\/86421\/revisions\/265539"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/media\/86445"}],"wp:attachment":[{"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/media?parent=86421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/categories?post=86421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ded9.com\/de\/wp-json\/wp\/v2\/tags?post=86421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}