Standard Mac setup for developers at Studio 24.
- Command Line Tools
- Homebrew
- PHP
- Software packages
- PhpStorm
- iTerm
- SSH
- Git
- Backup VPN service
- Oh My Zsh
- Optional software
- Local development environment
- Configure 1Password for SSH access
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 doctorIf there are any recommendations, it's worth following them.
You can update packages in Homebrew at any time via:
brew upgradeHomebrew will automatically do this when you install new packages that require updates.
Install the latest stable version of PHP:
brew install php
brew install composerSymfony installer:
brew install symfony-cli/tap/symfony-cliLaravel installer:
composer global require laravel/installerThis installs the following CLI commands:
php- PHPcomposer- Composerlaravel- Laravel CLIsymfony- Symfony CLI
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 github
brew install --cask imageoptim
brew install wget
brew install node
brew install nvm
brew install python
brew install pyenv
brew install awscli
brew install nano
brew install goaccess
brew install tableplus
brew install 1password-cliThis installs the following CLI commands:
aws- AWS CLInano- Simple text editornpm- Node Package Managernvm- Node Version Managerop- 1Password CLIpython3andpip3for Python 3wget- tool to download filesgoaccess- tool to analyse access logs. View the website for usage instructionsop- to use 1Password via the cli (for SSH etc)
Note
The support team will set you up with a JetBrains account based on your studio24.net email address.
- Open PhpStorm
- Activate license
- Log in to JetBrains account (this opens a web browser)
- Go back to PhpStorm and activate your license
When you set up PHPStorm you can install the following plugins (Settings > Plugins):
- Laravel Idea
- Symfony Plugin
Restart PHPStorm to activate plugins.
iTerm is a better terminal for the Mac.
brew install --cask iterm2
SSH is used to connect to remote servers, deploy code, and push code to GitHub.
Whenever you need to connect to a remote server please make sure you are on the either the Proton VPN or the backup OpenVPN/Tunnelblick
You should create a new SSH password when you use a new Mac, to help enforce good security.
Create a secure SSH key with a password. Store your SSH key password in your Employee 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.comIf this doesn't work, add the following to ~/.ssh/config:
Host github.com
Hostname ssh.github.com
Port 443
Add your SSH key to Studio 24 dev SSH keys repo by following the instructions under "Adding your public key" in the README.
This will give you permission to connect to remote servers. Please note these SSH keys are updated every half an hour on servers.
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_ed25519
Include ssh-config/*.conf
If your SSH private key is not called id_ed25519, use the correct name instead.
You can test this by outputting all host shortcuts:
~/.ssh/ssh-config/bin/show_hosts
You can update your SSH aliases via:
git -C ~/.ssh/ssh-config pull
Set default branch to main:
git config --global init.defaultBranch mainUser setup:
git config --global user.name "Your Name"
git config --global user.email you@example.com
git config --global pull.ff onlyIn 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.
Download the global .gitignore file via:
curl https://raw.githubusercontent.com/studio24/mac-setup/main/global-gitignore/.gitignore > ~/.gitignore
And tell Git to use it via:
git config --global core.excludesfile ~/.gitignore
All staff have access to the Studio 24 Proton VPN service for connecting to networks when not working from home or the office.
The development team can also access a second VPN service for use to connect to servers and deploy.
This service is hosted and managed by Mythic Beasts using OpenVPN and requires the use of Tunnelblick.
Please setup following this guide: Backup VPN service
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.
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-textTextmate 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
To install a local development environment, see the Local development environment document.
To setup and use 1Password for SSH access to servers, see the 1Password for SSH document.