Detailed Process of Updating Your UniFi Controller via SSH
Published onby Iron (edited on )
Updating your UniFi Controller via SSH might seem like a daunting task at first, but it’s actually quite manageable once you get the hang of it. Whether you're a seasoned network admin or just getting started, this guide will walk you through the process step by step.
By the end, you’ll be equipped with the knowledge to keep your UniFi Controller up to date, ensuring optimal performance and security for your network.
Let's Dive In!
Table of Contents
- Why Updating Your UniFi Controller Is Important
- Step 1: Preparing for the Update
- Step 2: Connecting to Your UniFi Controller
- Step 3: Downloading the Update
- Step 4: Installing the Update
- Step 5: Verifying the Update
- Troubleshooting Common Issues
- Final Thoughts
Why Updating Your UniFi Controller Is Important
Before diving into the update process, let’s discuss why keeping your UniFi Controller updated is essential. Regular updates offer several benefits:
-
Security Enhancements: Each update often includes patches for vulnerabilities that could otherwise be exploited by malicious actors. Staying up to date ensures that your network remains secure.
-
Performance Improvements: Updates frequently contain optimizations that can make your network run smoother and faster. Even if everything seems fine, these tweaks can improve overall performance.
-
New Features and Bug Fixes: Ubiquiti regularly adds new features and fixes bugs in the UniFi Controller software. By updating, you can take advantage of these new capabilities and avoid issues that may have been resolved.
Given these benefits, it’s clear why updating your UniFi Controller is not just recommended, but essential.
Step 1: Preparing for the Update
Preparation is key to a smooth update process. Here’s what you need to do before you begin:
- Backup Your Controller: The most crucial step before performing any update is to back up your UniFi Controller. This step cannot be overstated. A backup ensures that if anything goes wrong during the update, you can restore your system to its previous state.
To back up your controller, log in to your UniFi web interface and navigate to Settings > Maintenance > Backup. Create a backup file and store it in a safe location.
- Ensure SSH Access: You’ll need SSH access to your UniFi Controller to perform the update. SSH (Secure Shell) is a protocol that allows you to remotely access the controller’s command line interface. If you’re unfamiliar with SSH, here’s a quick guide:
- Open your terminal (Command Prompt for Windows, Terminal for macOS or Linux).
-
Connect to your controller by typing the following command:
Replace "username" with your SSH username and "controller-ip" with the IP address of your UniFi Controller. If this is your first time using SSH, you may need to install an SSH client.ssh username@controller-ip
- Check the Latest Version: Before starting the update, visit the Ubiquiti download page to find the latest version of the UniFi Controller software. Make a note of the version number and download URL, as you’ll need this information later.
Step 2: Connecting to Your UniFi Controller
With your preparations complete, the next step is to connect to your UniFi Controller via SSH. Here’s how:
-
Open your terminal: This will be Command Prompt if you’re on Windows or Terminal if you’re using macOS or Linux.
-
Connect via SSH: Enter the following command to establish a connection to your controller:
Replace "ubnt" with your actual SSH username and "192.168.1.1" with your UniFi Controller’s IP address.ssh [email protected]
-
Authenticate: You’ll be prompted to enter your password. Once authenticated, you’ll have access to the command line interface of your UniFi Controller.
Step 3: Downloading the Update
Now that you’re connected to your UniFi Controller, it’s time to download the latest update. Here’s what you need to do:
-
Use wget to Download: The "wget" command is a straightforward way to download files directly onto your controller. To download the latest UniFi Controller update, enter the following command:
Make sure you replace the URL with the exact download link for the latest version from the Ubiquiti download page. This command will download the update file directly to your controller.wget https://dl.ui.com/unifi/firmware/unifi_sysvinit_all.deb
-
Verify the Download: After the download is complete, it’s a good idea to verify that the file has been downloaded correctly. You can do this by listing the contents of the directory:
Look for the ".deb" file you just downloaded. Check its size and ensure it matches the expected file size from the download page.ls -lh
Step 4: Installing the Update
With the update file downloaded, the next step is to install it. Here’s how to proceed:
-
Run the Installation Command: To install the update, use the following command:
This command installs the downloaded ".deb" package. The "sudo" command runs the installation with administrative privileges, which are required for the update process.sudo dpkg -i unifi_sysvinit_all.deb
-
Monitor the Installation: The installation process will begin, and you’ll see various messages scrolling through your terminal. This is normal. The installation should take a few minutes, depending on the speed of your controller.
-
Automatic Restart: After the installation is complete, your UniFi Controller should automatically restart. If it doesn’t, you can manually restart it by running:
sudo systemctl restart unifi
Step 5: Verifying the Update
After the installation is complete and the controller has restarted, it’s crucial to verify that the update was successful. Here’s what to do:
-
Log into the Web Interface: Open your web browser and log into your UniFi Controller’s web interface. Check the version number displayed in the dashboard to confirm that it matches the version you just installed.
-
Check Network Functionality: Ensure that all devices are connected and functioning properly. Take a few moments to test the network’s performance and stability.
-
Restore from Backup if Needed: If you encounter any issues after the update, you can restore your controller from the backup you created earlier. To do this, go to Settings > Maintenance > Restore and upload the backup file.
Troubleshooting Common Issues
Even with the best preparation, issues can sometimes arise during or after the update process. Here are some common problems and how to address them:
-
Controller Not Responding: If your controller doesn’t come back online after the update, try rebooting it manually. You can do this via SSH with the following command:
If the controller still doesn’t respond, consider restoring from your backup.sudo reboot
-
Update Failed: If the update process fails, double-check the download URL and ensure that the ".deb" file is correct. Also, verify that there is enough free disk space on the controller:
If disk space is low, you may need to free up some space before retrying the update.df -h
-
SSH Connection Issues: If you can’t connect to your controller via SSH, check your network settings and ensure that SSH is enabled on the controller. You might also need to reboot your controller or check for any network issues that might be blocking SSH access.
Final Thoughts
Updating your UniFi Controller via SSH might initially seem complex, but as you can see, it’s a manageable process if you follow the steps carefully.
By keeping your controller up to date, you ensure that your network runs at its best, with enhanced security, improved performance, and access to the latest features.
Remember, the key to a successful update is preparation. Always back up your controller, double-check everything before proceeding, and take your time to ensure that the update process goes smoothly. If anything does go wrong, restoring from a backup is your safety net. And hey, if you’re looking for an easier way to manage your UniFi Controller updates without all the hassle, we’ve got you covered at UniHosted.
We host UniFi Controllers in the Cloud
Are you ready to take your UniFi Network to the next level? Deploy a UniFi Cloud Controller in minutes and manage your network from anywhere.
Free tier available
Get the best support
Join 1660+ customers
No credit card required