Learn how to configure Visual Studio Code to compile and upload ESP32 projects using the Arduino Community Edition plugin and Arduino CLI - no Arduino IDE needed.

Compile Arduino Core Based ESP32 Projects in Visual Studio Code

Learn how to configure Visual Studio Code to compile and upload ESP32 projects using the Arduino Community Edition plugin and Arduino CLI - no Arduino IDE needed.

Getting Started
Last Updated:

If you already live in Visual Studio Code, switching to the Arduino IDE just to compile a sketch feels like a step backward. The Arduino IDE's "Use External Editor" option lets you write code in VS Code, but you are still bouncing between two apps every time you build or upload. You do not need to - VS Code can handle editing, compiling, and uploading for ESP32 Arduino-core projects on its own. See VS Code vs Arduino IDE for ESP32 development for the fuller comparison; this guide covers the setup itself.

20-25 minutes Some VS Code familiarity helpful Works with any ESP32 variant

About the extension this guide uses. Microsoft's original VS Code Arduino extension was archived and pulled from the Marketplace in October 2024, after a critical remote-code-execution vulnerability was disclosed against it (CVE-2024-43488). Arduino Community Edition, the community fork this guide walks through, is what replaced it - but it has stayed on version 0.7.2 since (the same version the screenshots below show), a release the Marketplace's own version history dates to September 2024. Its GitHub repository is not archived and still receives occasional commits (a maintainer resurfaced in late August 2026 after a long quiet stretch), and an open pull request there addresses a related command-execution issue, but that fix has not shipped as a new Marketplace version as of this update. Install it if you want the point-and-click board/port pickers and IntelliSense, but do not treat it as a long-term dependency: arduino-cli, which does the actual compiling and uploading underneath, is maintained directly by Arduino and updated independently of whatever state the extension is in. If the extension ever stops working entirely, the CLI commands later in this guide still work from a plain terminal.

Looking for PlatformIO? That is a different (and more integrated) route to ESP32 development in VS Code, with its own project format and build system - covered in our PlatformIO ESP32 setup guide.

1Install VS Code

Grab the installer for your OS from the official VS Code website.

Windows

Download the installer and run it. VS Code launches from the Start menu afterward.

macOS

With Homebrew:

brew install --cask visual-studio-code

Linux

Download the .deb/.rpm package from the website, or install via your distro's package manager.

Launch it once it is installed - the next steps add the extensions and settings that get it ready for ESP32 development.

2Install the Arduino Community Edition extension

  1. Click the Extensions icon in the left sidebar (four small blocks).
  2. Search for Arduino Community Edition.
  3. Click Install on the result published by vscode-arduino.
VS Code Extensions Icon
The Extensions icon in the VS Code sidebar

This is the community-maintained continuation of Microsoft's original Arduino extension - it gives you compiling, uploading, and serial monitoring for .ino sketches from inside VS Code, backed by either the legacy Arduino IDE or, better, arduino-cli.

3Install arduino-cli

The extension can run against either backend, but arduino-cli is the one worth using: it is more stable with ESP32 boards, and it is the backend the extension itself is moving toward - support for the legacy Arduino IDE backend is planned for removal in a future version.

Windows

Download the installer or ZIP archive from the Arduino CLI releases page and add it to your PATH so VS Code can find it.

macOS

With Homebrew:

brew install arduino-cli

Linux

The official install script:

curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh

Confirm it is installed:

terminal Copy
arduino-cli version

A version string means you are good to go.

4Point the extension at arduino-cli

The extension needs the full path to the arduino-cli binary, not just the command name.

Windows

In Command Prompt or PowerShell:

Command Prompt / PowerShell Copy
where arduino-cli

macOS / Linux

terminal Copy
which arduino-cli

With Homebrew, that path is typically:

/opt/homebrew/bin/arduino-cli
Arduino CLI Location
Finding the arduino-cli binary path (shown here with zsh's where builtin - which arduino-cli returns the same path)

Copy that path - you need it for the extension settings below.

Skipping this step is also an option. The extension bundles its own copy of arduino-cli and can use it out of the box - leave Arduino: Path empty and just enable Arduino: Use Arduino CLI. Pointing it at the CLI you installed yourself, as this guide does, keeps the extension in sync with whatever version you use directly in a terminal or other tools.

Open the Arduino Community Edition settings in VS Code and find Arduino: Path.

VS Code Arduino Plugin COG Settings
Opening the Arduino Community Edition extension settings

Paste the path to the arduino-cli binary you found above. On macOS with Homebrew, that is typically:

/opt/homebrew/bin/arduino-cli

Then find Arduino: Use Arduino CLI and check it - this switches the extension from the legacy Arduino IDE backend to arduino-cli.

VS Code Arduino Plugin Settings Configured
Arduino: Path and Arduino: Use Arduino CLI configured

Restart VS Code so the new settings take effect.

Set up your project folder

Create a new folder for your project, and inside it a .ino file with the same name as the folder - the Arduino build system expects this.

test/
  test.ino

Open that folder in VS Code (File → Open Folder..., or drag it into the window).

5Select the ESP32 board and port

With the extension and CLI configured, three new items appear in the status bar at the bottom of VS Code: <Select Programmer>, <Select Board Type>, and <Select Port>.

Status bar items not showing? They sometimes only appear after you trigger a sketch. Open the Command Palette (CMD + Shift + P on macOS, Ctrl + Shift + P on Windows/Linux) and run Arduino: Select Sketch first.

Click <Select Board Type> in the status bar.

VS Code Arduino Plugin Select Board
Clicking Select Board Type in the status bar

A new tab opens with the board list:

VS Code Arduino Plugin Select Board Tab
The board selection tab

Pick the ESP32 board you are using - it should match the name from the Arduino Core for ESP32, such as ESP32 Dev Module or ESP32-S3-DevKitC-1. Not sure which entry fits your board? Every page in the boards database lists its exact Arduino entry. Here, ESP32S3 Dev Module (ESP32) is selected:

VS Code Arduino Plugin ESP32 S3 Dev Module Selected
ESP32S3 Dev Module selected as the board

Then click <Select Port> and pick the port your board is connected to.

Set the build output location

Your project folder now includes a hidden .vscode directory with an arduino.json file - the extension's per-project settings. Open it and add an output key:

.vscode/arduino.json Copy
"output": "build"
VS Code Arduino Plugin Added Build Output Location
arduino.json with the output key added

Without this key, the extension recreates a temporary output folder on every build, so nothing carries over between compiles. Setting output keeps compiled binaries and intermediate files in a build subfolder inside the project instead, which lets the extension reuse them and speeds up repeat builds. The extension's own documentation notes that this folder is best kept outside the workspace entirely - in practice, a plain subfolder name like build, as used here, is what most setups use without issue.

6Verify and upload

Open the Command Palette (CMD + Shift + P on macOS, Ctrl + Shift + P on Windows/Linux) and run Arduino: Verify to build your sketch.

VS Code Arduino Plugin Arduino Verify Command
Running Arduino: Verify from the Command Palette

The extension uses arduino-cli to compile the .ino file against the board you selected. On success, a build folder appears in your project directory with the compiled output:

VS Code Arduino Plugin Build Success Output
A successful build's output folder

To upload: connect the board over USB, confirm the port is selected in the status bar, then run Arduino: Upload from the Command Palette.

VS Code Arduino Plugin Arduino Upload Command
Running Arduino: Upload from the Command Palette

The output panel at the bottom shows the upload progress. Once it finishes, your program is running on the ESP32 - the same result as the Arduino IDE, without ever opening it.

From here, two guides worth a look: ESP-IDF vs Arduino Core if you want to know what you would gain by dropping the Arduino APIs entirely, and using ESP-IDF with VS Code if you decide to make that move. For a project to build next, try sending a message from ESP32 to Discord or an RGB LED color picker over WebSocket. And if your board has two USB ports and you have wondered why, this post explains it.

Frequently asked questions

Do I need the Arduino Community Edition extension, or can I just use arduino-cli directly?
The extension is a convenience layer - board and port pickers, one-click verify/upload, IntelliSense. Every one of those actions calls arduino-cli underneath, so you can skip the extension entirely and run arduino-cli compile and arduino-cli upload from the VS Code terminal. The CLI is what actually does the work, and it is maintained on its own schedule, independent of the extension.
Is the Arduino Community Edition extension actively maintained?
It is a community fork of Microsoft's original vscode-arduino extension, which Microsoft archived and pulled from the Marketplace in October 2024. The fork has stayed on version 0.7.2 since, a release the Marketplace's own version history dates to September 2024, even though its GitHub repository still gets occasional commits. Treat it as a convenience add-on rather than something to depend on; arduino-cli itself is maintained directly by Arduino and updated far more often.
Which backend should I choose in the extension - Arduino CLI or the legacy Arduino IDE?
Arduino CLI. It is the backend the extension itself now pushes you toward - support for the legacy Arduino IDE backend is planned for removal in a future version - and it is more stable for ESP32 projects, with better version control and scripting support.
Where does VS Code store the compiled build output?
Wherever you point it with the output key in .vscode/arduino.json. Leave it unset and the extension uses a temporary system folder that gets recreated on every build, which also means every build starts from scratch. Setting an output folder lets it reuse intermediate files between builds.
My ESP32 board is not showing up in the board list. What is wrong?
Confirm arduino-cli itself sees the ESP32 core installed by running arduino-cli core list in a terminal, and check that the extension's Arduino: Path setting points at the folder containing the arduino-cli binary, not the binary file itself. If the board list is empty entirely, the extension is not finding arduino-cli at all.

Where to next