<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ubuntu Core on Wimpy's World</title><link>https://blog.wimpys.world/tags/ubuntu-core/</link><description>Recent content in Ubuntu Core on Wimpy's World</description><generator>Hugo -- gohugo.io</generator><language>en-gb</language><managingEditor>martin@wimpress.com (Martin Wimpress)</managingEditor><webMaster>martin@wimpress.com (Martin Wimpress)</webMaster><lastBuildDate>Tue, 13 Dec 2016 17:17:00 +0000</lastBuildDate><atom:link href="https://blog.wimpys.world/tags/ubuntu-core/rss.xml" rel="self" type="application/rss+xml"/><item><title>Raspberry Pi 3 Nextcloud Box running on Ubuntu Core</title><link>https://blog.wimpys.world/posts/raspberry-pi-3-nextcloud-box-running-on-ubuntu-core/</link><pubDate>Tue, 13 Dec 2016 17:17:00 +0000</pubDate><author>martin@wimpress.com (Martin Wimpress)</author><guid>https://wimpysworld.com/posts/raspberry-pi-3-nextcloud-box-running-on-ubuntu-core/</guid><description>&lt;p&gt;I recently bought the &lt;a href="https://nextcloud.com/box/"&gt;Nextcloud Box&lt;/a&gt;. When
it came to setting it up I ran into a problem, I only had Raspberry Pi 3
computers available and at the time of writing the microSDHC card
provided with the Nextcloud Box only supports the Raspberry Pi 2. &lt;em&gt;Bummer!&lt;/em&gt;&lt;/p&gt;
&lt;h1 id="overview"&gt;Overview&lt;/h1&gt;
&lt;p&gt;This guide outlines how to use &lt;a href="https://www.ubuntu.com/core"&gt;Ubuntu Core&lt;/a&gt;
on the &lt;a href="https://www.raspberrypi.org/"&gt;Raspberry Pi 3&lt;/a&gt; to run &lt;a href="https://nextcloud.com/"&gt;Nextcloud&lt;/a&gt;
provided as a &lt;a href="http://snapcraft.io"&gt;snap&lt;/a&gt; from the Ubuntu store.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re not familiar with Ubuntu Core, here&amp;rsquo;s a quote:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Ubuntu Core is a tiny, transactional version of Ubuntu for IoT devices and large container deployments. It runs a new breed of super-secure, remotely upgradeable Linux app packages known as snaps&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;After following this guide Ubuntu Core and any installed snaps (and
their data) will reside on the SD card and the 1TB hard disk in the
Nextcloud box will be available for file storage. This
guide explains how to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install and configure Ubuntu Core 16 for the Raspberry Pi 3&lt;/li&gt;
&lt;li&gt;Format the 1TB hard disk in the Nextcloud Box and auto-mount it&lt;/li&gt;
&lt;li&gt;Install the Nextcloud snap and connect the &lt;code&gt;removable-media&lt;/code&gt; interface to allow access to the hard disk&lt;/li&gt;
&lt;li&gt;Activate and configure the Nextcloud &lt;em&gt;External Storage&lt;/em&gt; app so the hard disk can be used to store files&lt;/li&gt;
&lt;li&gt;Optional configuration of Email and HTTPS for Nextcloud&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="prepare-a-microsdhc-card"&gt;Prepare a microSDHC card&lt;/h2&gt;
&lt;p&gt;I explained the main steps in this post but you &lt;em&gt;really should&lt;/em&gt; read and
follow the &lt;a href="https://developer.ubuntu.com/en/snappy/start/raspberry-pi-2/"&gt;Get started with a Raspberry Pi 2 or 3&lt;/a&gt;
page as it fully explains how to use a desktop computer to download an
Ubuntu Core image for your Raspberry Pi 2 or 3 and copy it to an SD card
ready to boot.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s how to create an Ubuntu Core microSDHC card for the Raspberry Pi
3 using an Ubuntu desktop:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Download &lt;a href="http://releases.ubuntu.com/ubuntu-core/16/ubuntu-core-16-pi3.img.xz"&gt;Ubuntu Core 16 image for Raspberry Pi 3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Insert the microSDHC card into your PC
&lt;ul&gt;
&lt;li&gt;Use &lt;a href="apt://gnome-disk-utility"&gt;GNOME Disks&lt;/a&gt; and its &lt;em&gt;Restore Disk Image&amp;hellip;&lt;/em&gt; option, which &lt;strong&gt;natively supports XZ compressed images.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Select your SD card from the panel on the left&lt;/li&gt;
&lt;li&gt;Click the &amp;ldquo;burger menu&amp;rdquo; on the right and Select &lt;em&gt;Restore Disk Image&amp;hellip;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Making sure the SD card is still selected, click the Power icon on the right.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Eject the SD card physically from your PC.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="text-center"&gt;&lt;img src="GNOME-Disks-Restore-Disk-Image.png" class="img-fluid" alt="GNOME Disks - Restore Disk Image" /&gt;&lt;/div&gt;
&lt;h2 id="ubuntu-core-first-boot"&gt;Ubuntu Core first boot&lt;/h2&gt;
&lt;p&gt;An Ubuntu SSO account is required to setup the first user on Ubuntu Core:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Start by creating an &lt;a href="https://login.ubuntu.com/"&gt;Ubuntu SSO account&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Import an &lt;a href="https://login.ubuntu.com/ssh-keys"&gt;SSH Key into your Ubuntu SSO account&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;Here are &lt;a href="https://help.ubuntu.com/community/SSH/OpenSSH/Keys"&gt;instructions to generate an SSH Key&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;You&amp;rsquo;ll need a keyboard and monitor connected to the Raspberry Pi 3 to go complete the first boot process and device configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Insert the Ubuntu Core microSHDC into the Raspberry Pi, which should be
in the &lt;a href="https://nextcloud.com/wp-content/themes/next/assets/files/Box-Assembly-Guide.pdf?x16328"&gt;assembled Nextcloud Box&lt;/a&gt;
with a keyboard and monitor connected. Plug in the power.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The system will boot then become ready to configure&lt;/li&gt;
&lt;li&gt;The device will display the prompt &lt;em&gt;&amp;ldquo;Press enter to configure&amp;rdquo;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Press enter then select &lt;em&gt;&amp;ldquo;Start&amp;rdquo;&lt;/em&gt; to begin configuring your network and an administrator account. Follow the instructions on the screen, you will be asked to configure your network and enter your Ubuntu SSO credentials&lt;/li&gt;
&lt;li&gt;At the end of the process, you will see your credentials to access your Ubuntu Core machine:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;This device is registered to &amp;lt;Ubuntu SSO email address&amp;gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Remote access was enabled via authentication with the SSO user &amp;lt;Ubuntu SSO user name&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Public SSH keys were added to the device for remote access.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="login"&gt;Login&lt;/h3&gt;
&lt;p&gt;Once setup is done, you can login to Ubuntu Core using ssh, from a
computer on the same network, using the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ssh &amp;lt;Ubuntu SSO user name&amp;gt;@&amp;lt;device IP address&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The user name is your Ubuntu SSO user name.&lt;/p&gt;
&lt;h3 id="reconfiguring-network"&gt;Reconfiguring network&lt;/h3&gt;
&lt;p&gt;Should you need to reconfigure the network at a later stage you can do
so with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo console-conf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="prepare-1tb-hard-disk"&gt;Prepare 1TB hard disk&lt;/h2&gt;
&lt;p&gt;Log in to your Raspberry Pi 3 running Ubuntu Core via ssh.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ssh &amp;lt;Ubuntu SSO user name&amp;gt;@&amp;lt;device IP address&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="partition-and-format-the-nextcloud-box-hard-disk"&gt;Partition and format the Nextcloud Box hard disk&lt;/h3&gt;
&lt;p&gt;This will create a single partition formatted with the ext4 filesystem.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo fdisk /dev/sda
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Do the following to create the partition:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Command (m for help): o
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Created a new DOS disklabel with disk identifier 0x253fea38.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Command (m for help): n
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Partition type
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; p primary (0 primary, 0 extended, 4 free)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; e extended (container for logical partitions)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Select (default p): p
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Partition number (1-4, default 1): 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;First sector (2048-1953458175, default 2048):
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Last sector, +sectors or +size{K,M,G,T,P} (2048-1953458175, default 1953458175):
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Created a new partition 1 of type &amp;#39;Linux&amp;#39; and of size 931.5 GiB.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Command (m for help): w
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now format the partition and give it the label &lt;strong&gt;data&lt;/strong&gt;. This label will
be used to reference it for mounting later:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo mkfs.ext4 -L data /dev/sda1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="automatically-mount-the-partition"&gt;Automatically mount the partition&lt;/h3&gt;
&lt;p&gt;Most of the Ubuntu Core root file system is read-only, so it is not
possible to edit &lt;code&gt;/etc/fstab&lt;/code&gt;. Therefore we&amp;rsquo;ll use &lt;a href="https://www.freedesktop.org/wiki/Software/systemd/"&gt;systemd&lt;/a&gt;
to achieve that.&lt;/p&gt;
&lt;p&gt;Be aware of one of the &lt;code&gt;systemd.mount&lt;/code&gt; pitfalls:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Mount units must be named after the mount point directories they control. Example: the mount point /home/lennart must be configured in a unit file home-lennart.mount.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Yes that&amp;rsquo;s right! &lt;strong&gt;The unit filename must match the mount point path&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Create the &lt;code&gt;media-data.mount&lt;/code&gt; unit:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo vi /writable/system-data/etc/systemd/system/media-data.mount
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Add the following content:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-systemd" data-lang="systemd"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;[Unit]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;Mount unit for data&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;[Mount]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;What&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/dev/disk/by-label/data&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;Where&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/media/data&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;ext4&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;[Install]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="na"&gt;WantedBy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;multi-user.target&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Reload systemd, scanning for new or changed units:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl daemon-reload
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Start the &lt;code&gt;media-data.mount&lt;/code&gt; unit, which will mount the volume, and also
enable it so it will be automatically mounted on boot.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl start media-data.mount
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl &lt;span class="nb"&gt;enable&lt;/span&gt; media-data.mount
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And just like any other unit, you can view its status using
&lt;code&gt;systemctl status&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl status media-data.mount
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="update-ubuntu-core"&gt;Update Ubuntu Core&lt;/h2&gt;
&lt;p&gt;Make sure Ubuntu Core is up-to-date and reboot.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo snap refresh
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo reboot
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After the reboot, make sure &lt;code&gt;/media/data&lt;/code&gt; is mounted. If not double
check the steps above.&lt;/p&gt;
&lt;h2 id="install-nextcloud"&gt;Install Nextcloud&lt;/h2&gt;
&lt;p&gt;The Nextcloud snap uses the &lt;code&gt;removable-media&lt;/code&gt; interface, which grants
access to &lt;code&gt;/media/*&lt;/code&gt;, and requires manual connection:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo snap install nextcloud
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo snap connect nextcloud:removable-media core:removable-media
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Browse to the Nextcloud IP address and create the admin user account,
for example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://nextcloud.local/"&gt;http://nextcloud.local/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="nextcloud-configuration"&gt;Nextcloud configuration&lt;/h2&gt;
&lt;p&gt;In the examples below replace &lt;code&gt;nextcloud.local&lt;/code&gt; with the IP address or
hostname of your Nextcloud Box and replace &lt;code&gt;example.org&lt;/code&gt; with your domain.&lt;/p&gt;
&lt;h3 id="external-storage"&gt;External Storage&lt;/h3&gt;
&lt;p&gt;Enable the External Storge app via:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://nextcloud.local/index.php/settings/apps?category=disabled#"&gt;http://nextcloud.local/index.php/settings/apps?category=disabled#&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Configure External Storage app via:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://nextcloud.local/index.php/settings/admin/externalstorages"&gt;http://nextcloud.local/index.php/settings/admin/externalstorages&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Use these settings:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Folder name: &lt;em&gt;data&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;External storage: &lt;em&gt;Local&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Authentication: &lt;em&gt;None&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Configuration: &lt;code&gt;/media/data&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Available for: &lt;em&gt;All&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="email"&gt;Email&lt;/h3&gt;
&lt;p&gt;Configure your outgoing email settings via:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://nextcloud.local/index.php/settings/admin/additional"&gt;http://nextcloud.local/index.php/settings/admin/additional&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I use &lt;a href="https://sendgrid.com/"&gt;Sendgrid&lt;/a&gt; for sending email alerts from my
servers and devices. These are the settings that work for me:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Send mode: &lt;em&gt;SMTP&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Encryption: &lt;em&gt;STARTTLS&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;From address: &lt;em&gt;&lt;a href="mailto:nextcloud@example.org"&gt;nextcloud@example.org&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Authentication method: &lt;em&gt;Plain&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Authentication required: &lt;em&gt;Yes&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Server address: &lt;em&gt;smtp.sendgrid.net:587&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Username: &lt;code&gt;apikey&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Password: &lt;code&gt;theactualapikey&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="enabling-https"&gt;Enabling HTTPS&lt;/h3&gt;
&lt;p&gt;It is strongly recommend that you use HTTPS if you intend to expose your
Nextcloud to the Internet.&lt;/p&gt;
&lt;p&gt;First do a test to see if you can install a Let&amp;rsquo;s Encrypt certificate:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo nextcloud.enable-https -d
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Answer the questions:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Have you met these requirements? (y/n) y
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Please enter an email address (for urgent notices or key recovery): name@example.org
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Please enter your domain name(s) (space-separated): nextcloud.example.org
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Attempting to obtain certificates... done
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Looks like you&amp;#39;re ready for HTTPS!
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If everything went well, then install the certificate&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo nextcloud.enable-https
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Answer the questions again:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Have you met these requirements? (y/n) y
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Please enter an email address (for urgent notices or key recovery): name@example.org
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Please enter your domain name(s) (space-separated): nextcloud.example.org
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Attempting to obtain certificates... done
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Restarting apache... done
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If Let&amp;rsquo;s Encrypt didn&amp;rsquo;t work for you, you can always use Nextcloud with
a self-signed certificate.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo nextcloud.enable-https -s
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="manual-configuration-changes"&gt;Manual configuration changes&lt;/h3&gt;
&lt;p&gt;If you need to make any tweaks to the Nextcloud configuration file you
can edit it like so:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo vi /var/snap/nextcloud/current/nextcloud/config/config.php
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you have manually edited the Nextcloud configuration you may need to
restart nextcloud:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo snap disable nextcloud
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo snap &lt;span class="nb"&gt;enable&lt;/span&gt; nextcloud
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;So there it is, Nextcloud running on Ubuntu Core powered by a Raspberry
Pi 3. The performance is reasonable, obviously not stellar, but certainly
good enough to move some cloud services for a small family away from the
likes of Google and Dropbox. Now go and install some
&lt;a href="https://nextcloud.com/install/#install-clients"&gt;Nextcloud clients for your desktops and devices&lt;/a&gt; :-)&lt;/p&gt;</description><summary>Creating a Pi 3 powered Nextcloud Box with Ubuntu Core</summary></item></channel></rss>