In the Arduino IDE, libraries can be installed in several ways:
- By adding a .zip library file.
- By manually placing the library inside the libraries subfolder.
- The most common method: installing through the Library Manager.
On Windows, these libraries are typically installed under the system partition (for example, inside the user’s Documents folder). Some packages—such as the ESP32 Arduino Core—can take several gigabytes of disk space, which may lead to storage pressure on the system drive.
To avoid this issue, you can change the Sketchbook location so that libraries and sketches are stored in another directory.
Open Arduino IDE Preferences::
- Windows/Linux:
File → Preferences - MacOs:
Arduino IDE → Setting(orArduino IDE → Preferencesdepending on version)
In the Preferences window, look for the Sketchbook location field. Typical default locations are:
- Windows:
C:\Users\YourName\Documents\Arduino - macOS:
~/Documents/Arduino - Linux:
~/Arduino
Click the Browse (or similar) button next to it.
Choose (or create) the new folder you want to use as your sketchbook directory. Libraries will then be installed to: NewLocation/libraries
Click OK to save the changes.
Important (especially in IDE 2.x): After changing the sketchbook location, close and restart the Arduino IDE to ensure the new path is fully applied and libraries are reloaded correctly..
After this change:
New libraries from Library Manager will download and install to NewLocation/libraries.New sketches will be saved by default in the new sketchbook folder. Previously installed libraries will remain in the old location unless you move them manually..