Although the sketchbook is a convenient place to store your Arduino sketches, the use of the sketchbook folder as the location for saving sketches is not mandatory. You can choose any arbitrary location when saving your sketch.
However, Arduino IDE does mandate that libraries installed via Library Manager are installed under the libraries subfolder of the sketchbook folder. So setting the "Sketchbook location " preference to a location not on the C: drive will ensure that Arduino IDE does not use C: for library installations.
However, Arduino IDE also uses several other folders that are not relative to the sketchbook folder.
Folders Used by Arduino IDE
Here is an overview of the most significant external folders that contain files used or generated by Arduino IDE:
Build Cache
When you compile a sketch, Arduino IDE stores the compiled objects in order to allow them to be reused in order to reduce the duration of future compilations when appropriate.
Build caches are stored under the following location:
C:\Users\<username>\AppData\Local\arduino\
(where <username> is your Windows username)
If looking for it with your file manager or command line, note that the AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
The location of the build cache folder is configurable via the build_cache.path key in the arduino-cli.yaml configuration file. See the instructions under the Configuration via arduino-cli.yaml section below.
Configuration Folder
Arduino IDE stores some configuration data files in this folder. It is at the following location:
C:\Users\<username>\.arduinoIDE\
(where <username> is your Windows username)
The location of the configuration folder is not configurable.
Data Folder
The Arduino IDE Boards Manager installs boards platforms to this folder. The folder is also used to store some other Arduino files:
- The index files that provide the data for populating Boards Manager and Library Manager
- The fundamental Arduino libraries (e.g., Keyboard, Mouse, Servo)
- The archive files downloaded by Boards Manager and Library Manager
The "Data Folder" is at the following location:
C:\Users\<username>\AppData\Local\Arduino15\
(Where <username> is your Windows username)
If looking for it with your file manager or command line, note that the AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
The location of the data folder is configurable via the directories.data key in the arduino-cli.yaml configuration file. See the instructions under the Configuration via arduino-cli.yaml section below.
Logs Folder
Arduino IDE generates log files while it is running. These log files can be used to troubleshoot problems that are experienced when using the application.
The log files are stored at this location:
C:\Users\<username>\AppData\Roaming\Arduino IDE\
(where <username> is your Windows username)
If looking for it with your file manager or command line, note that the AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
The location of the logs folder is not configurable.
User Data Folder
Arduino IDE stores some data files in this folder. It is at the following location:
C:\Users\<username>\AppData\Roaming\arduino-ide\
(where <username> is your Windows username)
If looking for it with your file manager or command line, note that the AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
The location of the user data folder is not configurable.
Configuration via arduino-cli.yaml
Although they are not configurable via the Arduino IDE GUI, some of the folders listed above can be configured by editing a configuration file that is used by Arduino IDE. I'll provide instructions you can follow to do that:
- Select File > Quit from the Arduino IDE menus if it is running.
All IDE windows will close. - Open the file at the following path in any text editor:
(whereC:\Users\<username>\.arduinoIDE\arduino-cli.yaml<username>is your Windows username) - Edit the paths that are configured via the relevant keys in the content of the
arduino-cli.yamlfile. If the file doesn't already contain the key you want to configure, just add it to the file. - Save the file.
- Move the files from the previous path to the newly configured path.
- Start Arduino IDE.
Let's say that, for example, you wanted to change the location of the build cache folder to D:\arduino\build-cache. When you look at the contents of arduino-cli.yaml you notice that the file doesn't already contain the relevant build_cache.path key. So you would add the following to the file:
build_cache:
path: D:\arduino\build-cache
Continuing with the example, let's say you wanted to change the location of the data folder to D:\arduino\data. When you look at the contents of arduino-cli.yaml you notice that the file already contains the relevant directories.data key:
directories:
data: C:\Users\foo\AppData\Local\Arduino15
So you would change the existing content to:
directories:
data: D:\arduino\data