Standard Mac setup for developers at Studio 24.
You may need to re-install these when upgrading to a new OS version (you need to run this after upgrading to macOS Ventura). Toggle privileges (so you have admin rights) and run the following in terminal:
xcode-select --install
Make sure you run the commands to add Homebrew to your path (the install command tells you what this is).
Verify it works.
brew doctor
If there are any recommendations, it's worth following them.
Update to latest version
brew update
brew upgrade
brew cleanup
Install following software via Homebrew. Please install packages from Homebrew one-by-one, since they may include setup instructions (e.g. for NVM):
brew install --cask phpstorm
brew install --cask tuple
brew install --cask github
brew install --cask imageoptim
brew install --cask 1password/tap/1password-cli
brew install openssl
brew install wget
brew install node
brew install nvm
brew install ruby
brew install python
brew install wp-cli
brew install pyenv
brew install awscli
brew install nano
brew install goaccess
brew install symfony-cli/tap/symfony-cli
This installs the following CLI commands:
aws
- AWS CLInano
- Simple text editornpm
- Node Package Managernvm
- Node Version Managerop
- 1Password CLIpython3
andpip3
for Python 3symfony
- Symfony CLIwget
- tool to download fileswp
- WP CLIgoaccess
- tool to analyse access logs. View the website for usage instructions
iTerm is a better terminal for the Mac.
brew install --cask iterm2
We use Oh My Zsh to customise your terminal, install via:
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
We use two plugins:
Install these via:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Edit your ~/.zshrc
file:
nano ~/.zshrc
Add the plugins to the list of plugins for Oh My Zsh to load:
plugins=(
# other plugins...
zsh-syntax-highlighting zsh-autosuggestions
)
Close and re-open iTerm to enable the new plugins.
You can also use different themes if you wish. The team prefer the
agnoster
theme, which you need to install a Powerline font to use. You can do this via:
git clone --depth 1 git@github.com:powerline/fonts.git ~/fonts
cd ~/fonts
./install.sh
cd ../
rm -Rf fonts
Update your ~/.zshrc
file:
ZSH_THEME="agnoster"
You then need to select a Powerline font in iTerm (Preferences > Profile > Text). Noto Mono for Powerline
is recommended.
When you setup PHPStorm install the following plugins:
- .env files support
- EditorConfig
- Symfony
- Laravel
Login to your JetBrains account to activate.
Optional, install these if you want to use them:
brew install --cask rapidapi
brew install --cask textmate
brew install --cask cyberduck
brew install --cask visual-studio-code
brew install --cask transmit
brew install --cask sublime-text
Textmate installs the following CLI commands:
mate
- CLI command to open text files in Textmate
If you have a license (front-end team):
brew install --cask sketch
Set default branch to main:
git config --global init.defaultBranch main
User setup:
git config --global user.name "Your Name"
git config --global user.email you@example.com
Create a secure SSH key with a password. Store your SSH key password in your personal private vault in 1Password.
See instructions on Generating a new SSH key and adding it to the ssh-agent.
- Copy keys to GitHub
- Set the key title to your computer name (so you remember where this came from)
- To copy your SSH public key to the clipboard:
pbcopy < ~/.ssh/id_ed25519.pub
- Test access to GitHub:
ssh -T git@github.com
If this doesn't work, add the following to ~/.ssh/config
:
Host github.com
Hostname ssh.github.com
Port 443
In order to access private repos and push code to any repos you need to be a member of the Studio 24 team. Request this from the Support Team.
We use a global gitignore file to ignore IDE and OS files we don't want to commit to git. Any project files you want
to exclude from git must be added to the project .gitignore
file.
Install the global .gitignore file via:
curl https://raw.github.com/studio24/mac-setup/blob/main/global-gitignore/.gitignore > ~/.gitignore
git config --global core.excludesfile ~/.gitignore
Whenever you need to connect to a remote server please make sure you are on the VPN.
Developers need to add your SSH key to Studio 24 dev SSH keys repo. This will give you permission to deploy websites. Please note these SSH keys are updated every half an hour on servers.
Important note: always use SSH (secure shell) when cloning a git repo, not HTTPS.
We use a shared ssh-config file to help accessing remote servers.
Install this via:
git clone git@github.com:studio24/ssh-config.git ~/.ssh/ssh-config
Create a ~/.ssh/config
file and add the following to it:
Host *
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
Include ssh-config/*.conf
If your ssh key is not called id_rsa
, use the correct name instead.
You can test this by outputting all host shortcuts:
~/.ssh/ssh-config/bin/show_hosts
You can use the privileges app to temporarily act as an admin user, you'll need to do this to start MAMP Pro.
- Open "Privileges" app
- Right-click the icon and select Options > Keep in Dock
- Select "request privileges" to setup this up for the first time
You can now toggle privileges in the dock at any time. Make sure you toggle privileges to open MAMP, you must toggle privileges back after MAMP has opened.
To install PHP, Composer and MySQL, see the Local development environment document.