Can I build Unity WebGL on Codemagic?

Last updated: August 6, 2026

Context

You want to build a Unity project targeting WebGL using Codemagic's CI/CD pipeline and are wondering whether this build target is supported.

Answer

WebGL is not supported out of the box on Codemagic build machines. The pre-installed Unity versions on Codemagic only include the macOS, Android, and iOS build modules by default.

However, you can still build for WebGL by manually installing the WebGL module in your workflow using the Unity Hub CLI. Follow these steps:

  1. Activate your Unity license first, before running any Unity Hub CLI commands.

  2. Install the WebGL module by adding the following step to your workflow script:

    - name: Install WebGL module
      script: |
        "/Applications/Unity Hub.app/Contents/MacOS/Unity Hub" -- --headless \
          install-modules --version $UNITY_VERSION -m webgl
  3. Build with the WebGL target by using -buildTarget WebGL in your Unity build command.

  4. Zip the WebGL output folder before collecting it as an artifact, since Codemagic artifacts must be files rather than directories.

For more details on installing Unity versions and modules, refer to the Codemagic documentation on installing Unity versions.