Skip to main content

Installation

Cog works on macOS, Linux, and Windows 11 with WSL 2.

Prerequisites

Before installing Cog, you’ll need:
Docker is required. Cog uses Docker to create containers for your models. You’ll need to install Docker before you can run Cog.
If you install Docker Engine instead of Docker Desktop, you will need to install Buildx as well.

macOS Installation

The easiest way to install Cog on macOS is using Homebrew:
brew install replicate/tap/cog
This method automatically handles code signing and permissions.

Using the Install Script

You can also use our install script:
sh <(curl -fsSL https://cog.run/install.sh)

Manual Installation

Download and install the latest release directly from GitHub:
sudo curl -o /usr/local/bin/cog -L "https://github.com/replicate/cog/releases/latest/download/cog_$(uname -s)_$(uname -m)"
sudo chmod +x /usr/local/bin/cog
macOS Security WarningIf you downloaded the binary manually and see a “cannot be opened because the developer cannot be verified” error, run:
sudo xattr -d com.apple.quarantine /usr/local/bin/cog
Installing via Homebrew handles this automatically.

Linux Installation

Using the Install Script

Download and run the install script:
sh <(curl -fsSL https://cog.run/install.sh)

Manual Installation

Download the binary directly:
sudo curl -o /usr/local/bin/cog -L "https://github.com/replicate/cog/releases/latest/download/cog_$(uname -s)_$(uname -m)"
sudo chmod +x /usr/local/bin/cog

Docker Container Installation

If you’re installing Cog inside a Docker container:
RUN sh -c "INSTALL_DIR=\"/usr/local/bin\" SUDO=\"\" $(curl -fsSL https://cog.run/install.sh)"

Windows Installation

Cog works on Windows 11 with WSL 2 (Windows Subsystem for Linux).
1

Install WSL 2

Follow the official WSL 2 installation guide from Microsoft.
2

Install Docker Desktop

Install Docker Desktop for Windows and ensure WSL 2 integration is enabled.
3

Install Cog in WSL

Open your WSL terminal and follow the Linux installation instructions:
sh <(curl -fsSL https://cog.run/install.sh)
For detailed WSL 2 setup instructions, see the Using Cog with Windows 11 guide.

Upgrading Cog

Homebrew

If you installed with Homebrew on macOS:
brew upgrade replicate/tap/cog

Other Methods

For all other installation methods, upgrade by running the same commands you used to install Cog. The install script and manual download will always fetch the latest version.

Verify Installation

Verify that Cog is installed correctly:
cog --version
You should see the version number printed.

Next Steps

Quickstart

Run your first prediction with Cog

Your Own Model

Package your own model with Cog

Build docs developers (and LLMs) love