# macOS

> Install evcc on macOS with Homebrew, start it as a launchd service and keep it updated, or install it manually if you want to try a nightly build.

This guide describes the installation for macOS (10.12 and higher) using the [Homebrew](https://brew.sh) package manager.

> **Note**
>
> If you want to install evcc without a package manager or test a nightly version, check out the [Manual Installation](#manual) section.

## Installation

1. ### Install

   Open a terminal window and install [Homebrew](https://brew.sh), if it’s not already installed.

   ```sh
   brew trust --tap evcc-io/tap
   brew tap evcc-io/tap
   brew update
   brew install --cask evcc
   ```

2. ### Start

   evcc is shipped as a Homebrew cask, which cannot be managed by `brew services`. Create a launchd agent instead. It starts evcc at login and restarts it if it stops:

   ```sh
   mkdir -p "$(brew --prefix)/var/log"
   cat > ~/Library/LaunchAgents/io.evcc.plist <<EOF
   <?xml version="1.0" encoding="UTF-8"?>
   <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
   <plist version="1.0">
   <dict>
     <key>Label</key>
     <string>io.evcc</string>
     <key>ProgramArguments</key>
     <array>
       <string>$(brew --prefix)/bin/evcc</string>
     </array>
     <key>WorkingDirectory</key>
     <string>$(brew --prefix)</string>
     <key>RunAtLoad</key>
     <true/>
     <key>KeepAlive</key>
     <true/>
     <key>StandardOutPath</key>
     <string>$(brew --prefix)/var/log/evcc.log</string>
     <key>StandardErrorPath</key>
     <string>$(brew --prefix)/var/log/evcc.log</string>
   </dict>
   </plist>
   EOF
   launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/io.evcc.plist
   ```

3. ### Set up

   Open the evcc interface in your browser: <http://localhost:7070>. Set an administrator password and configure your devices directly via the web interface.

## Configuration

> **Recommended**
>
> Configure evcc directly in your browser.

After the first start, you can configure evcc at <http://localhost:7070>. Settings are automatically saved in the database.

Alternatively, you can use an `evcc.yaml` configuration file at `/etc/evcc.yaml`. Details can be found in [Configuration](/en/installation/configuration).

## Upgrades

To upgrade to a new version of evcc, perform the following steps:

* Open a terminal window

* Update package lists:

  ```sh
  brew update
  ```

* Upgrade evcc:

  ```sh
  brew upgrade --cask evcc
  ```

* Restart evcc:

  ```sh
  launchctl kickstart -k gui/$(id -u)/io.evcc
  ```

> **OCPP and the Application Firewall**
>
> Each upgrade installs a new binary, which the macOS Application Firewall treats as a new application. If the firewall is enabled, incoming connections are blocked until the new version is approved. OCPP chargers can no longer connect, while everything else keeps working. On a headless Mac the approval dialog is never seen. Approve the binary from the command line after each upgrade:
>
> ```sh
> sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add "$(brew --prefix)/bin/evcc"
> launchctl kickstart -k gui/$(id -u)/io.evcc
> ```

### Upgrading from the Homebrew formula

Up to version 0.314.5 evcc was shipped as a Homebrew formula and started with `brew services`. Homebrew does not upgrade an installed formula to a cask, so `brew upgrade` keeps reporting the old version as up-to-date. Remove the formula once and install the cask:

```sh
brew services stop evcc
brew uninstall evcc
brew update
brew install --cask evcc
```

Then create the launchd agent as described in [Start](#start). Your configuration and database are not affected.

## Additional Commands

* Check the status of the evcc server:

  ```sh
  launchctl print gui/$(id -u)/io.evcc
  ```

* Stop evcc and remove the launchd agent:

  ```sh
  launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/io.evcc.plist
  ```

* View logs:

  ```sh
  tail -f "$(brew --prefix)/var/log/evcc.log"
  ```

## Manual Installation

Here you’ll find instructions for manually installing evcc on macOS.

### Installation

* Download the appropriate file to your system:
  * 64-bit ARM or Intel CPU: [evcc\_X.XX\_macOS\_all.tar.gz](https://github.com/evcc-io/evcc/releases/latest)

* Extract the downloaded file (e.g., by double-clicking the file)

* There will now be a new folder with the `evcc` program

* Open a terminal and navigate to the folder containing the `evcc` program

* Start evcc with the following command:

  ```sh
  ./evcc -v
  ```

* You should see the current version of evcc (e.g., `evcc version 0.xxx.y`).

### Configuration

After the first start, open <http://localhost:7070> in your browser and configure evcc via the web interface.

Alternatively, you can create an `evcc.yaml` configuration file (see [Configuration](/en/installation/configuration)) and start evcc with it:

```sh
./evcc -c evcc.yaml
```

### Updates/Downgrades

Follow the steps above and replace the evcc program file with the new or previous version. The configuration does not need to be redone.