{"id":7162,"date":"2017-12-12T22:40:14","date_gmt":"2017-12-12T21:40:14","guid":{"rendered":"https:\/\/nzbusenet.com\/?p=7162"},"modified":"2023-07-23T12:28:01","modified_gmt":"2023-07-23T10:28:01","slug":"install-sonarr-ubuntu","status":"publish","type":"post","link":"https:\/\/nzbusenet.com\/en\/install-sonarr-ubuntu\/","title":{"rendered":"Installing Sonarr Ubuntu via command line for tv series"},"content":{"rendered":"\n<p>In this manual Sonarr install Ubuntu. We&#8217;re going to install Sonarr on a Computer with Ubuntu. We do this via the command-line. Once we have established a connection, via the command line. Then let&#8217;s do the following.<\/p>\n\n<p>First we need to Update the installed software.<\/p>\n<div class='code-block code-block-8' style='margin: 8px 0; clear: both; width: 700px; height: 250px;'>\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-4833496329174552\"\n     crossorigin=\"anonymous\"><\/script>\n<!-- nzbusenetinberichten2021 -->\n<ins class=\"adsbygoogle\"\n     style=\"display:inline-block;width:700px;height:250px\"\n     data-ad-client=\"ca-pub-4833496329174552\"\n     data-ad-slot=\"6745544931\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/div>\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>sudo apt-get update &amp;&amp; sudo apt-get upgrade -y<\/p>\n<\/blockquote>\n\n<p>To be sure. That you get the latest version of Sonarr.<\/p>\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>sudo apt-key adv &#8211;keyserver hkp:\/\/keyserver.ubuntu.com:80 &#8211;recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF<br \/>echo &#8220;Deb Http:\/\/download.mono-project.com\/repo\/debian wheezy main&#8221; | sudo tee\/etc\/apt\/sources.list.d\/mono-xamarin.list<\/p>\n<\/blockquote>\n\n<p>Installation possibility o https to allow installations.<\/p>\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>sudo apt-get install apt-transport-https-y<\/p>\n<\/blockquote>\n\n<p>Add the installation source for Sonarr.<\/p>\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>sudo apt-key adv&#8211;keyserver keyserver.ubuntu.com&#8211;recv-Keys FDA5DFFC<br \/>echo &#8220;deb https:\/\/apt.sonarr.tv\/ master main&#8221; | sudo tee -a\/etc\/apt\/sources.list.d\/sonarr.list<\/p>\n<\/blockquote>\n\n<p>Now we&#8217;re going to install Sonarr.<\/p>\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>sudo apt-get update<br \/>sudo apt-get install nzbdrone -y<\/p>\n<\/blockquote>\n\n<p>Now put the rights to sonarr&#8217;s folder right.<\/p>\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>sudo chown -R \/Opt\/NzbDrone<\/p>\n<\/blockquote>\n\n<p>You are now done installing Sonarr on Ubuntu.<\/p>\n\n<h2 class=\"wp-block-heading\">Sonarr auto-start during Ubuntu startup<\/h2>\n\n<p>We&#8217;re going to create a script now. So so so so that Sonarr starts automatically. During the startup of Ubuntu.<\/p>\n<div class='code-block code-block-8' style='margin: 8px 0; clear: both; width: 700px; height: 250px;'>\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-4833496329174552\"\n     crossorigin=\"anonymous\"><\/script>\n<!-- nzbusenetinberichten2021 -->\n<ins class=\"adsbygoogle\"\n     style=\"display:inline-block;width:700px;height:250px\"\n     data-ad-client=\"ca-pub-4833496329174552\"\n     data-ad-slot=\"6745544931\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><\/div>\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>sudo nano \/etc\/init.d\/nzbdrone<\/p>\n<\/blockquote>\n\n<p>Paste the following script here. And change only the users name.<\/p>\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>APP_PATH=\/opt\/NzbDrone<\/p>\n\n\n\n<p># User ID<br \/>RUN_AS=your user name<\/p>\n\n\n\n<p># Path to Mono bin<br \/>DAEMON=$(which mono)<\/p>\n\n\n\n<p># Location to save PID file.<br \/>PID_FILE=\/var\/run\/nzbdrone\/nzbdrone.pid<br \/>PID_PATH=$(dirname $PID_FILE)<\/p>\n\n\n\n<p># script name<br \/>NAME=nzbdrone<\/p>\n\n\n\n<p># app name<br \/>DESC=NzbDrone<\/p>\n\n\n\n<p># start-ups args<br \/>EXENAME=&#8221;NzbDrone.exe&#8221;<br \/>DAEMON_OPTS=&#8221; &#8220;$EXENAME<\/p>\n\n\n\n<p>################end edit me ##################<\/p>\n\n\n\n<p>NZBDRONE_PID=`ps auxf | grep NzbDrone.exe | grep -v grep | awk &#8216;{print $2}&#8217;`<\/p>\n\n\n\n<p>test -x $DAEMON || exit 0<\/p>\n\n\n\n<p>set -e<\/p>\n\n\n\n<p>#Look for PID and create if doesn&#8217;t exist<br \/>if [ ! -d $PID_PATH ]; then<br \/>mkdir -p $PID_PATH<br \/>chown $RUN_AS $PID_PATH<br \/>fi<\/p>\n\n\n\n<p>if [ ! -d $DATA_DIR ]; then<br \/>mkdir -p $DATA_DIR<br \/>chown $RUN_AS $DATA_DIR<br \/>fi<\/p>\n\n\n\n<p>if [ -e $PID_FILE ]; then<br \/>PID=`cat $PID_FILE`<br \/>if ! kill -0 $PID &gt; \/dev\/null 2&gt;&amp;1; then<br \/>echo &#8220;Removing stale $PID_FILE&#8221;<br \/>rm $PID_FILE<br \/>fi<br \/>fi<\/p>\n\n\n\n<p>echo $NZBDRONE_PID &gt; $PID_FILE<\/p>\n\n\n\n<p>case &#8220;$1&#8221; in<br \/>start)<br \/>if [ -z &#8220;${NZBDRONE_PID}&#8221; ]; then<br \/>echo &#8220;Starting $DESC&#8221;<br \/>rm -rf $PID_PATH || return 1<br \/>install -d &#8211;mode=0755 -o $RUN_AS $PID_PATH || return 1<br \/>start-stop-daemon -d $APP_PATH -c $RUN_AS &#8211;start &#8211;background &#8211;pidfile $PID_FILE &#8211;exec $DAEMON &#8212; $DAEMON_OPTS<br \/>else<br \/>echo &#8220;NzbDrone already running.&#8221;<br \/>fi<br \/>;;<br \/>stop)<br \/>echo &#8220;Stopping $DESC&#8221;<br \/>echo $NZBDRONE_PID &gt; $PID_FILE<br \/>start-stop-daemon &#8211;stop &#8211;pidfile $PID_FILE &#8211;retry 15<br \/>;;<\/p>\n\n\n\n<p>restart|force-reload)<br \/>echo &#8220;Restarting $DESC&#8221;<br \/>start-stop-daemon &#8211;stop &#8211;pidfile $PID_FILE &#8211;retry 15<br \/>start-stop-daemon -d $APP_PATH -c $RUN_AS &#8211;start &#8211;background &#8211;pidfile $PID_FILE &#8211;exec $DAEMON &#8212; $DAEMON_OPTS<br \/>;;<br \/>status)<br \/># Use LSB function library if it exists<br \/>if [ -f \/lib\/lsb\/init-functions ]; then<br \/>. \/lib\/lsb\/init-functions<br \/>if [ -e $PID_FILE ]; then<br \/>status_of_proc -p $PID_FILE &#8220;$DAEMON&#8221; &#8220;$NAME&#8221; &amp;&amp; exit 0 || exit $?<br \/>else<br \/>log_daemon_msg &#8220;$NAME is not running&#8221;<br \/>exit 3<br \/>fi<\/p>\n\n\n\n<p>else<br \/># Use Basic Functions<br \/>if [ -e $PID_FILE ]; then<br \/>PID=`cat $PID_FILE`<br \/>if kill -0 $PID &gt; \/dev\/null 2&gt;&amp;1; then<br \/>echo &#8221; * $NAME is running&#8221;<br \/>exit 0<br \/>fi<br \/>else<br \/>echo &#8221; * $NAME is not running&#8221;<br \/>exit 3<br \/>fi<br \/>fi<br \/>;;<br \/>*)<br \/>N=\/etc\/init.d\/$NAME<br \/>echo &#8220;Usage: $N {start|stop|restart|force-reload|status}&#8221; &gt;&amp;2<br \/>exit 1<br \/>;;<br \/>esac<\/p>\n\n\n\n<p>exit 0<\/p>\n<\/blockquote>\n\n<p>Save this script file. You do this by pressing <strong>ctrl+x<\/strong>. Then press<strong>y.<\/strong> And then press <strong>Enter<\/strong>.<\/p>\n\n<p>Now give the script export rights.<\/p>\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>sudo chmod +x \/etc\/init.d\/nzbdrone<\/p>\n<\/blockquote>\n\n<p>Take a script with you during startup.<\/p>\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>sudo update-rc.d nzbdrone defaults<\/p>\n<\/blockquote>\n\n<p>You are now done installing the boot script.<\/p>\n\n<p>You can test it with the following command.<\/p>\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>sudo reboot<\/p>\n<\/blockquote>\n\n<p>Your computer will now restart.<\/p>\n\n<p><strong>Sonarr Ubuntu manual<br \/><\/strong><\/p>\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/nzbusenet.com\/en\/sonarr-tutorial\/\">Sonarr tutorial<\/a>.<\/li>\n\n\n\n<li><a href=\"https:\/\/nzbusenet.com\/en\/install-sonarr-ubuntu\/\" target=\"_blank\" rel=\"noopener noreferrer\">Install Sonarr Ubuntu via the command line<\/a>.<\/li>\n\n\n\n<li><a href=\"https:\/\/nzbusenet.com\/en\/configure-sonarr-nzbget-ubuntu\/\" target=\"_blank\" rel=\"noopener noreferrer\">Configure Sonarr with NZBGet<\/a>.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>In this manual Sonarr install Ubuntu. We&#8217;re going to install Sonarr on a Computer with Ubuntu. We do this via the command-line. Once we have established a connection, via the command line. Then let&#8217;s do <a class=\"mh-excerpt-more\" href=\"https:\/\/nzbusenet.com\/en\/install-sonarr-ubuntu\/\" title=\"Installing Sonarr Ubuntu via command line for tv series\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":12223,"featured_media":50286,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[729],"tags":[],"class_list":{"0":"post-7162","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-sonarr-tutorial"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/nzbusenet.com\/wp-content\/uploads\/2016\/06\/Sonarr-installeren-Ubuntu.gif","_links":{"self":[{"href":"https:\/\/nzbusenet.com\/en\/wp-json\/wp\/v2\/posts\/7162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nzbusenet.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nzbusenet.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nzbusenet.com\/en\/wp-json\/wp\/v2\/users\/12223"}],"replies":[{"embeddable":true,"href":"https:\/\/nzbusenet.com\/en\/wp-json\/wp\/v2\/comments?post=7162"}],"version-history":[{"count":0,"href":"https:\/\/nzbusenet.com\/en\/wp-json\/wp\/v2\/posts\/7162\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nzbusenet.com\/en\/wp-json\/wp\/v2\/media\/50286"}],"wp:attachment":[{"href":"https:\/\/nzbusenet.com\/en\/wp-json\/wp\/v2\/media?parent=7162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nzbusenet.com\/en\/wp-json\/wp\/v2\/categories?post=7162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nzbusenet.com\/en\/wp-json\/wp\/v2\/tags?post=7162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}