Step 6.5 of 7 - macOS Setup
This guide will walk you through the process of setting up your Mac for coursework at LearningFuze. The steps need to be completed in the order provided. There are some video clips, pictures, and commands in this guide, but be sure to read all instructions thoroughly as you go so you don't accidentally skip a step.
Check System Requirements
First check to make sure that your Mac laptop meets these system requirements.
- Computer* less than 4 years old (depending on how fast it is)
- Intel, M1, or M2 processor
- 8GB RAM minimum, 16GB recommended
- 16GB of free disk space minimum
- macOS version 11 (Big Sur) or later
A laptop* is required for in-person LearningFuze courses.
If your macOS version is older than 11 (Big Sur), please update it now before continuing.
You can verify your version of macOS by following these steps. You can update your version of macOS with the built-in Software Update app.
Install Xcode Command Line Tools
At LearningFuze, you will use Git and GitHub, just like a professional developer. To enable Git on macOS, install the Xcode Command Line Tools. This is done using the Terminal app that comes with macOS.
Open a new Terminal window
- Press command ⌘ + space
- Type Terminal and press Return
- A Terminal window should appear.
You can install the Xcode Command Line Tools by pasting the following command into Terminal and pressing Return.
xcode-select --install
When you are prompted to install command line developer tools, click Install and Agree to the Command Line Tools License Agreement and wait for the installation to complete before moving on. You might see a huge time estimate like 80 hours, but it won't take that long 😆.
- ⚠️ If you receive an error message saying that
command line tools are already installed
, then Git is already enabled on your Mac and you can jump to the next section of this guide. - ⚠️ If installing the command line developer tools fails, try downloading and installing them manually. You can find the latest version of Command Line Tools for Xcode here.
Install Docker Desktop for Mac
At LearningFuze, we use Docker to create a professional-grade development sandbox on your computer. Docker must be running in the background to make this possible. This section of the guide walks you through the process of installing Docker on your Mac. Note: you do not need to sign up for anything to use Docker, so if you are asked to sign into DockerHub or create a Docker account, you can ignore it.
- For Intel Macs: Download Docker for Mac here.
- For M1 Macs: Download Docker for Mac here.
- Install Docker by opening the
.dmg
file you just downloaded and dragging Docker into your Applications. - Close the installer window.
- Open your Applications folder in Finder and open the Docker application.
- If prompted, continue opening Docker and provide the password you use to log into your Mac.
- Within a few moments, the status bar at the top-right of your screen should include a Docker whale icon.
- The Docker Dashboard will open too. Leave it open while the Docker Engine is starting.
- If the Docker Dashboard offers you a tutorial, choose Skip Tutorial.
- Click on the docker whale icon to check that "Docker Desktop is running".
- Then click the preferences gear icon and ensure that:
- "Start Docker Desktop when you log in" is CHECKED.
- "Open Docker Dashboard at startup" is UNCHECKED.
- You can now close the Docker Dashboard window, but leave Docker running in your status bar.
Run our Setup Script
At LearningFuze, you'll be using a customized configuration of Microsoft's Visual Studio Code. If you already have Visual Studio Code installed, it shouldn't cause any conflicts. The custom version is installed separately.
The following command requires that Docker is running. You can confirm the status of Docker by looking in the system tray on the right of your status bar. There will be a little whale icon, but it should have blocks on top now, and the icon should not be animating.
Open the Terminal application, then paste in the following command and press Return.
curl -fsSL 'https://lfz-static.s3.us-west-1.amazonaws.com/lfz-code/macos.sh' | sh
The setup script will do the following:
- verify that you have the required packages installed
- verify that you have Docker installed
- pull the Docker image used by our development sandbox
- download a standalone, customized Visual Studio Code editor
- generate a dedicated SSH key for your computer to authenticate with GitHub
- add a shortcut for
lfz-code
to your desktop
After the installation completes successfully, an icon for lfz-code
should appear on your desktop.
⚠️ If the setup script fails
If the setup script fails, Terminal will show you an error message. Find the lfz-code.log
file on your Desktop and send it to an instructor via Slack right away so we can figure out what went wrong and advise you on the next steps to take.
Add SSH Key to GitHub
Once the setup script has completed successfully, proceed with the following instructions.
Open the Terminal app and paste in the following command, then press Return. When you ran the setup script, a unique key was generated specifically for your Mac.
cat ~/.ssh/github_rsa.pub
Your SSH public key for GitHub should print, like in the video below. This key was created during the setup script and will be used to authenticate your laptop with GitHub so that you can freely download and upload your code.
Sign into your GitHub account and go to https://github.com/settings/keys. Click New SSH key on GitHub. Give the new key a name that will remind you which computer you pasted the key from. Copy-paste your key from Terminal into GitHub and click Add SSH key. If given the option, choose Authentication Key as the Key type.
To confirm that your SSH key was properly added to GitHub, go back to the Terminal app and paste in the following command, then press Return. Because this may be the first time that you are connecting your Mac to GitHub over SSH, you might receive a confirmation message asking you if you want to continue connecting. Type yes
and press Return. After that, you should receive a message confirming that you've successfully authenticated.
ssh git@github.com
Add your name and email address to Git
After your SSH key has been successfully uploaded to GitHub and you have verified that your Mac authenticates successfully, update Git to remember your name and email address. This should be your full name and the email address you used to sign up with GitHub.
Enter the following commands into Terminal to set your name and email address, but use your own name and email address instead of the examples.
git config --global user.name "Joe King"
git config --global user.email "joe@email.org"
You can check for typos with the following command. You may see some other values print, but the most important things to check are your name and email address. You can fix typos by running the above commands again.
git config --global --list
Clone your solutions repository from GitHub
When you signed into the Learning Management System, a new repository was create for you on your GitHub account. If you visit your profile on GitHub and then go to the Repositories tab, you should see it.
The repository will be named xxxx-code-solutions
where the xxxx
is your cohort number. For example, if student was enrolled in our Web-Dev Prep Class for October, 2020, their repository was named prep-1020-code-solutions. Your repository's name will be similar, but slightly different depending on which class you are enrolled in.
Note: If you cannot find your repository on GitHub, stop and notify an instructor via Slack.
To clone
In this step you are going to download a copy of this repository onto your computer.
- Be signed into your personal GitHub account at https://github.com
- Go to your Repositories page
- Find your code solutions repository and click on it
- Open the
lfz-code
app - Click the blue icon in the bottom-left of the Visual Studio Code window and choose Clone Repository in Container Volume...
- When Visual Studio Code warns you about arbitrary code execution, click Got it.
- Back on your repository page, click the Code button and copy the SSH URL from your repository. Only the SSH URL will work.
- Paste the URL back into the box in Visual Studio Code and press Return.
- Wait. The initial download might take a minute or two.
- When you see the message saying "Done. Press any key to close the terminal." press any key :)
Great! If you ran into problems, please contact an instructor via Slack. Otherwise, you have successfully cloned your repository!
Closing and reopening your solutions repository
This section of the guide shows you how to open your solutions back up after you have closed them. Visual Studio Code keeps a history of which repositories, files, and projects you have opened. You can see by following these steps.
- Close Visual Studio Code.
- Reopen
lfz-code
. - Go to the File menu.
- Go to Open Recent...
- Choose your recently-closed code solutions repository.
- Wait a moment.
Nice! Your repository should open back up again. This time it should open much faster. Any time you want to return to your solutions repository, you can get to it via File > Open Recent....