<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>how to install mastodon on ubuntu 18.04 Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/how-to-install-mastodon-on-ubuntu-18-04/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 09 Mar 2020 09:29:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>Install Mastodon on Ubuntu 18.04 with Let&#8217;s Encrypt SSL Certificate</title>
		<link>https://www.osradar.com/install-mastodon-on-ubuntu-18-04-with-lets-encrypt-ssl-certificate/</link>
					<comments>https://www.osradar.com/install-mastodon-on-ubuntu-18-04-with-lets-encrypt-ssl-certificate/#respond</comments>
		
		<dc:creator><![CDATA[sabi]]></dc:creator>
		<pubDate>Mon, 09 Mar 2020 09:29:30 +0000</pubDate>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[how to install mastodon on ubuntu 18.04]]></category>
		<category><![CDATA[Install mastodon on linux]]></category>
		<category><![CDATA[set up mastodon on ubuntu]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=18548</guid>

					<description><![CDATA[<p>Mastodon is a free and Open Source self-hosted social community Server licensed underneath AGPLv3. Mastodon is comparable in features to Twitter and permits you to submit hyperlinks, text, video and snap shots and percentage inside the globally interconnected micro-blogging community. On this publish, we will discuss the way to deploy Mastodon on Ubuntu 18.04 Linux [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-mastodon-on-ubuntu-18-04-with-lets-encrypt-ssl-certificate/">Install Mastodon on Ubuntu 18.04 with Let&#8217;s Encrypt SSL Certificate</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Mastodon is a free and Open Source self-hosted social community Server licensed underneath AGPLv3. Mastodon is comparable in features to Twitter and permits you to submit hyperlinks, text, video and snap shots and percentage inside the globally interconnected micro-blogging community. On this publish, we will discuss the way to deploy Mastodon on Ubuntu 18.04 Linux secured with Let&#8217;s Encrypt SSL Certificates.<br>Mastodon has a number of dependencies that need to be established. They include Ruby, PostgreSQL, Node.js, Yarn, Redis, Nginx e.t.c. Just follow the below steps to easily Install the Mastodon on your Ubuntu 18.04.</p>



<h2><strong>Salient Features of Mastodon</strong></h2>



<ul><li><strong>No vendor lock-in:</strong> Absolutely interoperable with any conforming platform</li><li> <strong>Real-time, chronological timeline updates:</strong> See the updates of human beings you’re following appear in real-time within the ui via WebSockets.</li><li> <strong>Safety and Moderation tols:</strong> Non-public posts, locked accounts, word filtering, muting, blocking off and all forms of different features, along with a reporting and moderation machine.</li><li> <strong>Media attachments like photos and quick movies:</strong> Upload and view photos and WebM/MP4 videos attached to the updates. Videos with no audio track are treated like GIFs; regular films are looped – like vines!</li><li> <strong>OAuth2 and a sincere REST API:</strong> Mastodon acts as an OAuth2 provider so 3rd  party apps can use the REST and Streaming APIs, ensuing in a wealthy app environment with a number of alternatives!</li></ul>



<h3><strong>Requirements</strong></h3>



<p>You&#8217;ll be required to have the below packages on Ubuntu 18.04.</p>



<ul><li>PostgreSQL (minimum 9.5 or later)</li><li>Redis</li><li>Ruby (minimum 2.4 or later)</li><li>Node.js (minimum 8 or later)</li></ul>



<p>Make sure you&#8217;ve the following already installed at your system.</p>



<ul><li>A machine running on <strong>Ubuntu 18.04</strong> Operating System.</li><li><strong>Domain Name </strong>as it will be required for the Mastodon Server. For instance example.com or you can also use as social.example.com.</li><li>The third and last thing is the <strong>SMTP server </strong>for the purpose of e-mail delivery service.</li></ul>



<h3><strong>Step 1: Update your System</strong></h3>



<p>As usual we do, update your system.</p>



<pre class="wp-block-verse">sudo apt -y update &amp;&amp; sudo apt -y upgrade </pre>



<p>After it restart your system.</p>



<pre class="wp-block-verse">sudo reboot</pre>



<h3><strong>Step 2: Install Node.js &amp; Yarn</strong></h3>



<p>Type the following command to install the Node.js</p>



<pre class="wp-block-verse">curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -<br>sudo apt-get install -y nodejs</pre>



<p>Make sure that the installation is successful by checking the version.</p>



<pre class="wp-block-verse">nodejs --version</pre>



<p>Now, install the yarn</p>



<pre class="wp-block-verse">curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -<br>echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list<br>sudo apt update<br>sudo apt -y install yarn</pre>



<h3><strong>Step 3: Install Required Dependency packages</strong></h3>



<p>Fire the below command to get installed the required dependency packages which are to be needed for the installation of the Mastodon on Ubuntu 18.04.</p>



<p>Make sure that these packages are to be installed locally.</p>



<pre class="wp-block-verse">sudo apt install -y imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git-core g++ libprotobuf-dev protobuf-compiler pkg-config nodejs gcc autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev nginx redis-server redis-tools certbot python-certbot-nginx yarn libidn11-dev libicu-dev libjemalloc-dev</pre>



<h3><strong>Step 4: Install Ruby</strong></h3>



<p>First of all create a user for Mastodon which will be used for these operations. I recommend you to run Ruby with <strong>rbenv</strong> because it allows you to manage multiple versions without any difficulty.</p>



<pre class="wp-block-verse">sudo adduser --disabled-login mastodon<br>sudo su - mastodon</pre>



<p>And then install the rbenv &amp; rbenv-build</p>



<pre class="wp-block-verse">git clone https://github.com/rbenv/rbenv.git ~/.rbenv<br> cd ~/.rbenv &amp;&amp; src/configure &amp;&amp; make -C src<br> echo 'export PATH="$HOME/.rbenv/bin:$PATH"' &gt;&gt; ~/.bashrc<br> echo 'eval "$(rbenv init -)"' &gt;&gt; ~/.bashrc<br> exec bash<br> git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build</pre>



<p>Then install the proper Ruby version.</p>



<pre class="wp-block-verse">RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 2.6.5<br>rbenv global 2.6.5</pre>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="719" height="322" src="https://www.osradar.com/wp-content/uploads/2020/03/install-mastodon-on-ubuntu-.png" alt="" class="wp-image-18972" srcset="https://www.osradar.com/wp-content/uploads/2020/03/install-mastodon-on-ubuntu-.png 719w, https://www.osradar.com/wp-content/uploads/2020/03/install-mastodon-on-ubuntu--300x134.png 300w, https://www.osradar.com/wp-content/uploads/2020/03/install-mastodon-on-ubuntu--696x312.png 696w" sizes="(max-width: 719px) 100vw, 719px" /></figure></div>



<p>As the default gem version shipped with Ruby 2.6.0 that is incompatible with the latest bundler. So, we may need to update gem &amp; install bundler.</p>



<pre class="wp-block-verse">gem update --system<br>gem install bundler --no-document<br>exit</pre>



<h3><strong>Step 5: Installing PostgreSQL Database Server</strong></h3>



<p>Make sure you&#8217;ve installed PostgreSQL Database Server. If you don&#8217;t have installed already, just follow the below link to get it installed on your system.</p>



<p><a href="https://www.osradar.com/postgresql-12-ubuntu-18-04/">How To Install PostgreSQL on Ubuntu 18.04</a></p>



<pre class="wp-block-verse">sudo -u postgres psql<br>CREATE USER mastodon CREATEDB:<br>\q</pre>



<h3><strong>Step 6:Downloading &amp; Installing Mastodon</strong></h3>



<p>As to download and set up the Mastodon, you&#8217;ve to switch from your default user to the Mastodon user we&#8217;ve created earlier.</p>



<p>After it run the following command to install mastodon on your system.</p>



<pre class="wp-block-verse">sudo apt -y install git<br>sudo su -mastodon</pre>



<p>Now, clone the Mastodon code</p>



<pre class="wp-block-verse">git clone https://github.com/tootsuite/mastodon.git live &amp;&amp; cd live<br>git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)</pre>



<p>Then install the dependencies</p>



<pre class="wp-block-verse">gem install bundler:1.17.3<br>bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without development test<br>yarn install --pure-lockfile</pre>



<p>Now, run the below command to generate a configuration.</p>



<pre class="wp-block-verse">RAILS_ENV=production bundle exec rake mastodon:setup</pre>



<p>When asked for the information required, please fill them accordingly.</p>



<pre class="wp-block-verse">/home/mastodon/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/rubygems_integration.rb:200: warning: constant Gem::ConfigMap is deprecated<br> Your instance is identified by its domain name. Changing it afterward will break things.<br> Domain name: example.com<br> Single user mode disables registrations and redirects the landing page to your public profile.<br> Do you want to enable single user mode? yes<br> Are you using Docker to run Mastodon? no<br> PostgreSQL host: /var/run/postgresql<br> PostgreSQL port: 5432<br> Name of PostgreSQL database: mastodon_production<br> Name of PostgreSQL user: mastodon<br> Password of PostgreSQL user: <br> Database configuration works! ?<br> Redis host: localhost<br> Redis port: 6379<br> Redis password: <br> Redis configuration works! ?<br> Do you want to store uploaded files on the cloud? No<br> Do you want to send e-mails from localhost? yes<br> E-mail address to send e-mails "from": Mastodon <a href="mailto:notifications@example.com">notifications@example.com</a><br> Send a test e-mail with this configuration right now? no<br> This configuration will be written to .env.production<br> Save configuration? Yes</pre>



<p>And when prompt for the compiling of assets select <strong>yes</strong>.</p>



<p>Then <strong>agree</strong> to the admin account creation</p>



<pre class="wp-block-verse">Done!<br> All done! You can now power on the Mastodon server <br> Do you want to create an admin user straight away? Yes<br> Username: admin<br> E-mail: admin@example.com<br> You can login with the password: 1b417e401f44c3db5d30f2f2f2a2328b<br> You can change your password once you login.</pre>



<p>After all these steps upgrade the yarn by running</p>



<pre class="wp-block-verse">yarn upgrade</pre>



<h3><strong>Step 7: Configuring Nginx</strong></h3>



<p>For the reverse proxy server, we&#8217;ll use Nginx for the Mastodon. Verify the status of nginx if it is in running condition</p>



<pre class="wp-block-verse">systemctl status nginx</pre>



<p>From the Mastodon directory, copy the config template for nginx by the below command.</p>



<pre class="wp-block-verse">sudo cp /home/mastodon/live/dist/nginx.conf /etc/nginx/sites-available/mastodon.conf</pre>



<p>Set up the correct DNS for Mastodon.</p>



<pre class="wp-block-verse">sudo vim /etc/nginx/sites-available/mastodon.conf</pre>



<p>When done, simply activate the config.</p>



<pre class="wp-block-verse">sudo ln -s /etc/nginx/sites-available/mastodon.conf /etc/nginx/sites-enabled/mastodon.conf</pre>



<pre class="wp-block-verse">sudo systemctl restart nginx</pre>



<p>Allow access through the firewall</p>



<pre class="wp-block-verse">sudo ufw allow 'Nginx Full'</pre>



<h3><strong>By Using Let&#8217;s Encrypt SSL Certificate</strong></h3>



<p>Type the command given to use the Let&#8217;s Encrypt Certificate.</p>



<pre class="wp-block-verse">sudo certbot --nginx -d exmaple.com</pre>



<p>Output:</p>



<p>You&#8217;ll see the similar output</p>



<pre class="wp-block-verse">sudo certbot --nginx -d social.osradar.com</pre>



<pre class="wp-block-verse">$ sudo certbot --nginx -d <a href="http://osradar.com">social.osradar.com</a><br>  Saving debug log to /var/log/letsencrypt/letsencrypt.log<br>  Plugins selected: Authenticator nginx, Installer nginx<br>  Enter email address (used for urgent renewal and security notices) (Enter 'c' to<br>  cancel): myemail@example.com<br> Please read the Terms of Service at<br>  https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must<br>  agree in order to register with the ACME server at<br>  https://acme-v02.api.letsencrypt.org/directory<br> (A)gree/(C)ancel: A<br> Would you be willing to share your email address with the Electronic Frontier<br>  Foundation, a founding partner of the Let's Encrypt project and the non-profit<br>  organization that develops Certbot? We'd like to send you email about our work<br>  encrypting the web, EFF news, campaigns, and ways to support digital freedom.<br> (Y)es/(N)o: Y<br>  Obtaining a new certificate<br>  Performing the following challenges:<br>  http-01 challenge for social.osradar.com<br>  Waiting for verification…<br>  Cleaning up challenges<br>  Deploying Certificate to VirtualHost /etc/nginx/sites-enabled/mastodon.conf<br>  Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.<br> 1: No redirect - Make no further changes to the webserver configuration.<br>  2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for<br>  new sites, or if you're confident your site works on HTTPS. You can undo this<br>  change by editing your web server's configuration.<br> Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2<br>  Redirecting all traffic on port 80 to ssl in /etc/nginx/sites-enabled/mastodon.conf<br> Congratulations! You have successfully enabled<br> <a href="https://social.osradar.com">https://social.osradar.com</a></pre>



<p>Note: Replace the example.com with your domain.</p>



<h3><strong>Step 8: Setting up systemd services</strong></h3>



<p>From the Mastodon directory, copy the systemd service template.</p>



<pre class="wp-block-verse">sudo cp /home/mastodon/live/dist/mastodon-*.service /etc/systemd/system/</pre>



<p>To Verify that the username &amp; paths are properly configured, edit the following files.</p>



<pre class="wp-block-verse">/etc/systemd/system/mastodon-web.service<br>/etc/systemd/system/mastodon-sidekiq.service<br>/etc/systemd/system/mastodon-streaming.service</pre>



<p>And then start &amp; enable the systemd services</p>



<pre class="wp-block-verse">sudo systemctl daemon-reload<br>for i in web sidekiq streaming; do sudo systemctl enable mastodon-$i &amp;&amp; sudo systemctl restart mastodon-$i; done</pre>



<p>Verify the status that it is working properly.</p>



<pre class="wp-block-verse">for i in web sidekiq streaming; do sudo systemctl enable mastodon-$i &amp;&amp; sudo systemctl restart mastodon-$i; done</pre>



<h3><strong>Step 9: Mastodon Dashboard</strong></h3>



<p>Access the Mastodon dashboard by visiting the domain in your browser. You will see the following screen. Just click on the<strong> Login</strong> button.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="1025" height="465" src="https://www.osradar.com/wp-content/uploads/2020/03/1-4.png" alt="how to install mastodon on ubuntu 18.04" class="wp-image-18973" srcset="https://www.osradar.com/wp-content/uploads/2020/03/1-4.png 1025w, https://www.osradar.com/wp-content/uploads/2020/03/1-4-300x136.png 300w, https://www.osradar.com/wp-content/uploads/2020/03/1-4-768x348.png 768w, https://www.osradar.com/wp-content/uploads/2020/03/1-4-696x316.png 696w, https://www.osradar.com/wp-content/uploads/2020/03/1-4-926x420.png 926w" sizes="(max-width: 1025px) 100vw, 1025px" /></figure></div>



<p>On the next screen appear, provide email and password of admin to continue.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="784" height="476" src="https://www.osradar.com/wp-content/uploads/2020/03/2-5.png" alt="setup mastodon on ubuntu 18.04" class="wp-image-18974" srcset="https://www.osradar.com/wp-content/uploads/2020/03/2-5.png 784w, https://www.osradar.com/wp-content/uploads/2020/03/2-5-300x182.png 300w, https://www.osradar.com/wp-content/uploads/2020/03/2-5-768x466.png 768w, https://www.osradar.com/wp-content/uploads/2020/03/2-5-696x423.png 696w, https://www.osradar.com/wp-content/uploads/2020/03/2-5-692x420.png 692w" sizes="(max-width: 784px) 100vw, 784px" /></figure></div>



<p>Then a tutorial will appear, complete it to finish the setup of Mastodon.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="807" height="602" src="https://www.osradar.com/wp-content/uploads/2020/03/3-5.png" alt="mastodon on ubuntu " class="wp-image-18975" srcset="https://www.osradar.com/wp-content/uploads/2020/03/3-5.png 807w, https://www.osradar.com/wp-content/uploads/2020/03/3-5-300x224.png 300w, https://www.osradar.com/wp-content/uploads/2020/03/3-5-768x573.png 768w, https://www.osradar.com/wp-content/uploads/2020/03/3-5-80x60.png 80w, https://www.osradar.com/wp-content/uploads/2020/03/3-5-265x198.png 265w, https://www.osradar.com/wp-content/uploads/2020/03/3-5-696x519.png 696w, https://www.osradar.com/wp-content/uploads/2020/03/3-5-563x420.png 563w" sizes="(max-width: 807px) 100vw, 807px" /></figure></div>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="827" height="601" src="https://www.osradar.com/wp-content/uploads/2020/03/4-2.png" alt="mastodon" class="wp-image-18976" srcset="https://www.osradar.com/wp-content/uploads/2020/03/4-2.png 827w, https://www.osradar.com/wp-content/uploads/2020/03/4-2-300x218.png 300w, https://www.osradar.com/wp-content/uploads/2020/03/4-2-768x558.png 768w, https://www.osradar.com/wp-content/uploads/2020/03/4-2-324x235.png 324w, https://www.osradar.com/wp-content/uploads/2020/03/4-2-696x506.png 696w, https://www.osradar.com/wp-content/uploads/2020/03/4-2-578x420.png 578w" sizes="(max-width: 827px) 100vw, 827px" /></figure></div>



<p>So, this is how you can Install Mastodon on Ubuntu 18.04. </p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="1017" height="569" src="https://www.osradar.com/wp-content/uploads/2020/03/5-4.png" alt="" class="wp-image-18977" srcset="https://www.osradar.com/wp-content/uploads/2020/03/5-4.png 1017w, https://www.osradar.com/wp-content/uploads/2020/03/5-4-300x168.png 300w, https://www.osradar.com/wp-content/uploads/2020/03/5-4-768x430.png 768w, https://www.osradar.com/wp-content/uploads/2020/03/5-4-696x389.png 696w, https://www.osradar.com/wp-content/uploads/2020/03/5-4-751x420.png 751w" sizes="(max-width: 1017px) 100vw, 1017px" /></figure></div>



<p>Congratulations! You&#8217;ve successfully installed Mastodon on Ubuntu 18.04 with Let&#8217;s Encrypt.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-mastodon-on-ubuntu-18-04-with-lets-encrypt-ssl-certificate/">Install Mastodon on Ubuntu 18.04 with Let&#8217;s Encrypt SSL Certificate</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/install-mastodon-on-ubuntu-18-04-with-lets-encrypt-ssl-certificate/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
