Use UbuntuCore to create a WiFi AP with nextcloud support on a Pi3 in minutes.

UbuntuCore is the rolling release of Ubuntu.
It is self updating and completely built out of snap packages (including kernel, boot loader and root file system) which provides transactional updates, manual and automatic roll-back and a high level of system security to all parts of the system.

Once installed you have a secure zero maintenance OS that you can easily turn into a powerful appliance by simply adding a few application snaps to it.

The raspberry Pi3 comes with WLAN and ethernet hardware on board, which makes it a great candidate to turn it into a WiFi AccessPoint. But why stop here ? With UbuntuCore we can go further and install a WebRTC solution (like spreedme) for making in-house video calls or an UPNP media server to serve our music and video collections, an OpenHAB home automation device … or we can actually turn it into a personal cloud using the nextcloud snap.

The instructions below walk you through a basic install of UbuntuCore, setting up a WLAN AP, adding an external USB disk to hold data for nextcloud and installing the nexcloud snap.

You need a Raspberry Pi3 and an SD card.


Create an account at and upload your public ssh key (~/.ssh/ in the “SSH Keys” section. This is where your UbuntuCore image will pull the ssh credentials from to provide you login access to the system (by default UbuntuCore does not create a local console login, only remote logins using this ssh key will be allowed).

Download the image from:

…or if you are brave and like to live on the edge you can use a daily build of the edge channel (…bugs included 😉) at:

Write the image to SD:

Put your SD card into your PC’s SD card reader …
Make sure it did not get auto mounted (in case it did, do not use the filemanager to unmount but unmount it using the commandline (in the example below my USB card reader shows the SD as /dev/sdb to the system)):

ogra@pc~$ mount | grep /dev/sdb # check if anything is mounted
ogra@pc~$ sudo umount /dev/sdb1 # unmount the partition
ogra@pc~$ sudo umount /dev/sdb2

Use the following command to write the image to the card:

ogra@pc~$ xzcat /path/to/ubuntu-core-16-pi3.img.xz | sudo dd of=/dev/sdb bs=8M

Plug the SD into your pi3, plug an ethernet cable and either a serial cable or a monitor and keyboard in and power up the board. Eventually you will se a “Please press enter” message on the screen, hitting Enter will start the installer.

Going through the installer …

Configure eth0 as default interface (the WLAN driver is broken in the current pi3 installer. Simply ignore the wlan0 device at this point):

Give your account info so the system can set up your ssh login:

The last screen of the installer will tell you the ssh credentials to use:

Ssh into the board, set a hostname and call sudo reboot (to work around the WLAN breakage):

ogra@pc:~$ ssh ogra@

It's a brave new world here in Snappy Ubuntu Core! This machine
does not use apt-get or deb packages. Please see 'snap --help'
for app installation and transactional updates.

ogra@localhost:~$ sudo hostnamectl set-hostname pi3
ogra@localhost:~$ sudo reboot

Now that we have installed our basic system, we are ready to add some nice application snaps to turn it into a shiny WiFi AP with a personal cloud to use from our phone and desktop systems.

Install and set up your personal WiFi Accesspoint:

ogra@pi3:~$ snap install wifi-ap
ogra@pi3:~$ sudo wifi-ap.setup-wizard
Automatically selected only available wireless network interface wlan0 
Which SSID you want to use for the access point: UbuntuCore 
Do you want to protect your network with a WPA2 password instead of staying open for everyone? (y/n) y 
Please enter the WPA2 passphrase: 1234567890 
Insert the Access Point IP address: 
How many host do you want your DHCP pool to hold to? (1-253) 50 
Do you want to enable connection sharing? (y/n) y 
Which network interface you want to use for connection sharing? Available are sit0, eth0: eth0 
Do you want to enable the AP now? (y/n) y 
In order to get the AP correctly enabled you have to restart the backend service:
 $ systemctl restart snap.wifi-ap.backend 
2017/04/29 10:54:56 wifi.address= 
2017/04/29 10:54:56 wifi.netmask=ffffff00 
2017/04/29 10:54:56 share.disabled=false 
2017/04/29 10:54:56 wifi.ssid=Snappy 
2017/04/29 10:54:56 
2017/04/29 10:54:56 
2017/04/29 10:54:56 disabled=false 
2017/04/29 10:54:56 dhcp.range-start= 
2017/04/29 10:54:56 dhcp.range-stop= 
2017/04/29 10:54:56 
Configuration applied succesfully 

Set up an USB key as permanently mounted disk:

Plug your USB Disk/Key into the Pi3 and immediately call the dmesg command afterwards so you can see the name of the device and its partitions … (in my case the device name is /dev/sda and there is a vfat partition on the device called /dev/sda1)

Now create /etc/systemd/system/media-usbdisk.mount with the following content:

Description=Mount USB Disk



And enable it:

ogra@pi3:~$ sudo systemctl daemon-reload 
ogra@pi3:~$ sudo systemctl enable media-usbdisk.mount 
ogra@pi3:~$ sudo systemctl start media-usbdisk.mount 

Install the nextcloud snap:

ogra@pi3:~$ snap install nextcloud 

Allow nextcloud to access devices in /media:

ogra@pi3:~$ snap connect nextcloud:removable-media 

Wait a bit, nextclouds auto setup takes a few minutes (make some tea or coffee) …

Turn on https:

ogra@pi3:~$ sudo nextcloud.enable-https self-signed 
Generating key and self-signed certificate... done 
Restarting apache... done 

Now you can connect to your new WiFi AP SSID and point your browser to afterwards.

Add an exception for the self signed security cert (note that nextcloud.enable-https also accepts Let’s Encrypt certs in case you own one, just call “sudo nextcloud.enable-https -h” to get all info) and configure nextcloud via the web UI.

In the nextcloud UI install the “External Storage Support” from the app section and create a new local Storage pointing to the /media/usbdisk dir so your users can store thier files on the external disk.



  1. Pingback: S10E09 – Elfin Moaning Wine | Ubuntu Podcast
  2. Neil A. · May 20

    This works well on a RPi2 with the Edimax wifi dongle on the end of a long USB cable outside the house. However, the time is set automatically to GMT. I cannot find anywhere the instructions to set the timezone. Maybe for a dumb IoT-type device, the correct time is not necessary, but I feel it is still good to set it. Any ideas?

    • ograblog · May 20

      you should be able to ssh in and use timedatectl:

      sudo timedatectl set-timezone Europe/Berlin

      works for me …
      (you can check available timezones with the list-timezones option)

  3. n-dru · May 25

    Thanks for sharing this guide, ograblog.

    I’m trying to create a WiFi AP on a RPi 3 Model B and I’m having problems when I run this command: systemctl restart snap.wifi-ap.backend

    The system returns this message:

    Failed to restart snap.wifi-ap.backend.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
    See system logs and ‘systemctl status snap.wifi-ap.backend.service’ for details.

    systemctl status snap.wifi-ap.backend.service returns the following:

    ● snap.wifi-ap.backend.service
    Loaded: not-found (Reason: No such file or directory)
    Active: inactive (dead)

    The network appears on my devices, but when I connect them to it (they do connect to it), there’s no Internet at all.

    Any ideas of thoughts about what might be happening?

    Thanks for your help!

    • ograblog · May 26

      if you watch closely, you will notice that “systemctl restart snap.wifi-ap.backend” is only part of the output of “sudo wifi-ap.setup-wizard” … you should not call it separately.
      if you want to actually use systemctl on an UbuntuCore system, make sure to use it with sudo though … 😉

      • n-dru · June 6

        Thanks a lot, @ograblog. Your’e absolutely right. This is the first time I tinker with Ubuntu Core and I’m still a lil bit confused. Thanks for your help.

  4. dz · June 15

    snap install seems very unreliable….
    I have made a dozen attempts to do the wifi-ap install…. download starts and then hangs
    attempt to restart results in wifi-ap has changes pending….
    after reboots I get a partial download and then mismatched hashes
    There needs to be a lot more polish before this takes “minutes”

    • ograblog · June 15

      hmm, is this a standard Pi3 ? did you use the daily image (recommended) or the stable one ? i have literally done that tens of times by now and there has never been such an issue, this smells rather like an issue with your setup (what kind of SD card are you using ? do you have any special network setup ? etc) or the image you picked.

      note that there are tens (if not hundrets) of thousands of commercial Ubuntu Core devices out there already (you can buy pre-installed snap based Ubuntu Core dell devices since 2015), if any commercial user would have reliability issues, they would be known (and they use the same images, store and snap packages). how about you file a bug at and we start researching what’s wrong with your system 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s