Skip to main content

Get started with Mojo🔥

The Mojo SDK is currently available for Ubuntu Linux systems and macOS systems running on Apple silicon. Support for Windows is coming soon. You can also develop from Windows or Intel macOS using a container or remote Linux system. Alternatively, you can also experiment with Mojo using our web-based Mojo Playground.

Get the Mojo SDK

Get Mojo in MAX!

To provide a unified toolkit for AI developers, the Mojo SDK is now included in the MAX SDK. To install the MAX SDK, see Get started with MAX Engine. If you want to install the standalone Mojo SDK, you're in the right place.

The Mojo SDK includes everything you need for local Mojo development, including the Mojo standard library and the Mojo command-line interface (CLI). The Mojo CLI can start a REPL programming environment, compile and run Mojo source files, format source files, and more.

We've also published a Mojo extension for Visual Studio Code to provide a first-class developer experience with features like code completion, quick fixes, and hover help for Mojo APIs.

System requirements

To use the Mojo SDK, you need a system that meets these specifications:

Linux:

  • Ubuntu 20.04/22.04 LTS
  • x86-64 CPU (with SSE4.2 or newer) or AWS Graviton2/3 CPU
  • Minimum 8 GiB RAM
  • Python 3.8 - 3.11
  • g++ or clang++ C++ compiler

Mac:

  • Apple silicon (M1 or M2 processor)
  • macOS Monterey (12) or later
  • Python 3.8 - 3.11
  • Command-line tools for Xcode, or Xcode

Support for Windows will be added in a future release.

Install Mojo

Already have modular?

If you already have the modular tool, update to version 0.5.1 or newer, and go to step 2.

  1. Open a terminal and install the modular command line tool:

    curl -s https://get.modular.com | sh -
  2. Then sign in to your Modular account with this command:

    modular auth
  3. Now you can install the Mojo SDK:

    modular install mojo
  4. Set environment variables so you can access the mojo CLI:

    If you're using Bash, run this command:

    MOJO_PATH=$(modular config mojo.path) \
    && BASHRC=$( [ -f "$HOME/.bash_profile" ] && echo "$HOME/.bash_profile" || echo "$HOME/.bashrc" ) \
    && echo 'export MODULAR_HOME="'$HOME'/.modular"' >> "$BASHRC" \
    && echo 'export PATH="'$MOJO_PATH'/bin:$PATH"' >> "$BASHRC" \
    && source "$BASHRC"

Next, get started with Hello, world!

If you have issues during install, check our known issues.

note

To help us improve Mojo, we collect some basic system information and crash reports. Learn more.

Update Mojo

Mojo is a work in progress and we will release regular updates to the Mojo language and SDK tools. For information about each release, see the Mojo changelog.

To check your current Mojo version, use the --version option:

mojo --version

To update to the latest Mojo version, use the modular update command:

modular update mojo

Update the Modular CLI

We may also release updates to the modular tool. Run the following commands to update the CLI on your system.

Linux:

sudo apt update
sudo apt install modular

Mac:

brew update
brew upgrade modular

Develop in the Mojo Playground

Instead of downloading the Mojo SDK, you can also experiment with Mojo in our online Playground.

What to expect

The Mojo Playground is a simple online editor where you can test out Mojo code for yourself.

  • We've included a handful of code examples to show you Mojo basics and demonstrate its capabilities.

  • This is an online sandbox and not useful for benchmarking.

  • You can download your code or share it as a gist, but there's no mechanism for saving code in the Playground itself. Any changes will be lost when you switch code examples (as well as in the event of a server refresh or update). If you come up with something you want to save—save it locally!

  • The Playground environment doesn't include any Python packages. In the future we intend to make some common Python packages available to import in the Playground.

  • There might be some bugs. Please report issues and feedback on GitHub.

Caveats

  • The Mojo environment does not have network access, and you cannot install any Mojo or Python packages. You only have access to Mojo and the Mojo standard library.

  • For a general list of things that don't work yet in Mojo or have pain-points, see the Mojo roadmap and sharp edges.