Controlling a Raspberry Pi Remotely from Anywhere in the World
The Raspberry Pi is a tiny, credit-card-sized computer that you can use to learn how to code and create awesome projects while also providing an inexpensive way to get into the DIY computing scene. It has built-in Wi-Fi, making it easy to connect remotely. Here’s how to control your Raspberry Pi from anywhere in the world with just a few simple steps using Terminal on Mac or Linux and PuTTY on Windows. You don’t need any prior coding experience!
Step 1: Setup Your Raspberry Pi
- Setup your Raspberry Pi
- Connect to your Raspberry Pi through SSH and change the hostname with the following command:
- sudo nano /etc/hosts
- Add a line for every device you want to control, substituting YOUR-NAME for where it says ‘server’ in this example:
- Save and exit nano by pressing Ctrl+X, Y, and Enter. The remote server will be added to your /etc/hosts file on your Raspberry Pi.
Step 2: Install Raspbian OS
Here is a tutorial on how to control a Raspberry Pi remotely from anywhere in the world. First, you need to download the Raspbian OS. Then, you need to extract the files and go through the installation steps. Finally, run it!
First, you need to download the Raspbian OS. The latest version is available on Download Raspberry Pi. There are two versions available—Raspbian Jessie Lite and Raspbian Pixel (with PIXEL desktop environment). If you plan to use SSH connection for remote control, then I recommend downloading the Raspbian Pixel image which has more features than lite version. Both images are around 4GB so downloading might take some time depending on your internet speed.
Step 3: Configure WiFi Connection
You’ll need to configure the Pi’s WiFi connection so that you can remotely connect to it from anywhere in the world. To do this, open a terminal window on your computer and type
After you’ve installed Wicd on your Raspbian operating system, it will automatically open and ask you to add your wireless network. Type in your wireless network password hit Connect and then hit OK. At that point, Wicd will scan for networks and display them. Select your network from the list and type in its security key if needed—the same process you’d use to connect to a wireless network on any laptop or smartphone. Hit Connect again to verify that it’s connected by looking at its signal strength, and then closing out of Wicd with Exit.
Step 4: Connect To Server
Once you have found the Raspberry Pi server that you want to control remotely, all you need to do is go back to your Raspberry Pi and make sure the password is correct and then just type in NC 192.168.0.10 1234 into a terminal on your Raspberry Pi.
You now should be able to control your Raspberry Pi remotely from anywhere you want. In order to check, type: top into a terminal on your server. You should see that there is no CPU usage anymore and that nothing is running, but if you type (in another terminal) cat /proc/cpuinfo into another terminal, you should see some new information about your processor. This means that everything has worked perfectly!
Step 5: Test The Connection
To test the connection, log in to the Raspberry Pi remotely using PuTTY. Open PuTTY and enter the Raspberry Pi’s IP address (e.g., 192.168.0.5) in the Host Name (or IP address) field and then click Open. Log in with your username and password from earlier and after a few seconds, you should be logged into your remote Raspberry Pi via PuTTY!
Connecting remotely using PuTTY can be very useful for everything from making sure that your Raspberry Pi is connected to your home network to troubleshooting any connection issues. It also allows you to access and control your Raspberry Pi via SSH. For example, if you’re running a Python script on your computer and want to see what it’s doing, or if you need access but forgot your SD card at home, you can connect via SSH and use it just like you were sitting right there with it!