Now that we have a working ownCloud installation on our Raspberry Pi, we need a way to be able to remotely access the device from across the internet. Knowing the IP address and forwarding the appropriate ports on the router is only part of the story: most residential ISPs will periodically change the external IP address of their customers for logistical reasons that we won’t get into here (it’s a matter of traditional infrastructure limitations and convenience for the ISP). We’re going to need a way to automatically keep track of the IP address of the device as it potentially changes; as a fortuitous consequence, we’re going to be able to get an easy-to-remember URL in exchange. To do all this, we’re going to set up dynamic DNS using No-IP on Raspberry Pi.
No-IP is a service that allows you to assign a static domain name to a dynamic IP address. Their basic level of service is free, but only affords a limited selection of domains and has to be renewed every 30 days. There are paid offerings available with more features, but for our purposes, we’ll stick with the free product. To get started, sign up for an account at www.noip.com. Once logged into your account, click the “Add a Host” button and fill in the appropriate information: choose a domain, host type [which should be DNS Host (A)], and the external IP address for the network to which the Raspberry Pi is connected. Click the “Add Host” button at the bottom, and then it’s time to set up the client on the RPi.
Using No-IP on Raspberry PI
On the Raspberry Pi, open a terminal session. The first thing we’ll need is a directory to install the Dynamic Update Client. Type
mkdir /home/pi/noip and press enter, then navigate to the directory by typing
Download the client by typing
wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz then unzar the archive file by invoking
tar vzxf noip-duc-linux.tar.gz and enter the newly written directory with
Now we can install the client using
sudo make and then
sudo make install. During the installation process, you will be asked for your NoIP credentials as well as your preferred refresh interval (in minutes). Enter them when prompted, then wait for the setup to complete.
Once the installation is complete, run the client by invoking
sudo /usr/local/bin/noip2. You can always check on the status of the client by invoking
sudo noip2 -S (for status!)
Now, all you have to do is set up port forwarding on your router to point port 80 to the Raspberry Pi. Every router’s instructions are going to be slightly different, so check your particular model’s documentation. My Linksys router hides the port forwarding options under the security section and the “Apps and gaming” section. If you make sure that HTTP (port 80) points to the internal IP address for the RPi, you should be able to navigate to the domain you previously set up on No-IP and reach the default Apache information page. If you get this page, everything is working!