As a developer, changing platforms is not really a straightforward process.
Recently, I purchased a MacBook Air M1 as another development machine in my toolkit. However, before I could use it, I had to set it up for work.
And one of the first things that needed to be done before anything else was setting up PuTTY as accessing remote servers via the shell is one of the most frequent and important things that I do.
When I jumped into setup PuTTY on my new MacBook Air, I realized that installing PuTTY on MacBook was not as simple as installing PuTTY on Windows is. So, I am jotting down the process below for anyone (or future me) who might need to see this.
Steps to install PuTTY on MacBook Air M1
- Install XCode from Apple App Store
- Install Command Line Tools for XCode for your version from here – https://developer.apple.com/download/all/
- Accept XCode Build license
- Download and install MacPorts from
- Download and install XQuartz
- Run selfupdate your system
- Fun-fact, we haven’t even installed PuTTY yet. We have just been preparing the ground so far
- Install PuTTY via the terminal
So, now let’s go through each of the above-mentioned steps in detail.
To install some pre-requisites which in turn will allow us to install PuTTY on the MacBook Air M1, you will need to install XCode. You can download and install it from here – https://developer.apple.com/xcode/resources/
Install Command Line Tools for XCode
Once XCode installation completes successfully, we need to install what is called XCode Command Line Tools. This, however, for me, was easier said than done. I could find the correct link to the Command Line Tools for my version of XCode after spending a good amount of town. Surprisingly, it was not where it was supposed to be found but buried deep down on Apple’s site.
Here’s the link for the same – https://developer.apple.com/xcode/resources/
Accept XCode License
After installing XCode Command Line Tools, fire up your terminal and type the following command:
sudo xcodebuild -license
You should see something like this:
If you don’t see this, try the command given below instead:
Scroll to the bottom by hitting the spacebar and once you are there, to accept, type accept, and hit return.
Download and Install MacPorts
Next, head to this URL to download MacPorts to your local computer after choosing the correct OS version running on your system. Once downloaded, install it.
Once MacPorts is installed, we need to now install something called XQuartz. Head to this page and download the .dmg file from there. Once downloaded, install it on your system.
Open your terminal again and type the following command:
sudo port -v selfupdate
Once the selfupdate has run successfully, we are now ready to install PuTTY. Phew!
The installation actually is pretty simple but all the groundwork that needs to be done before actually installing it is a lot of work. Run the following command to install PuTTY:
sudo port install putty
Within a few seconds, the installation should be complete and PuTTY should be ready to use on your MacBook. To run the application, type the command below:
I however have also created a shortcut on my desktop for easy access, as when I am working, I usually connect to multiple remote servers and have multiple instances of PuTTY running at any given time when I am working. It’s just easier to fire them up using a mouse click.
To create a shortcut, use the following command:
cp /opt/local/bin/putty ~/Desktop/PuTTY