# Which files to backup in .julia?

**URL:** <https://discourse.julialang.org/t/which-files-to-backup-in-julia/131906>\
**Category:** General Usage\
**Tags:** question\
**Created:** [August 28, 2025, 7:01am UTC](https://discourse.julialang.org/t/which-files-to-backup-in-julia/131906 "2025-08-28T07:01:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hadrien.theveneau](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hadrien.theveneau/32/218699_2.png) [@hadrien.theveneau](https://discourse.julialang.org/u/hadrien.theveneau)\
**Post date:** [August 28, 2025, 7:01am UTC](https://discourse.julialang.org/t/which-files-to-backup-in-julia/131906/1 "2025-08-28T07:01:37Z")

</div>

Hi everyone,

I regularly backup my WSL2 home directory, and I realized that the .julia folder is rather big. Is there any parts of this folder which I can skip ?

Many thanks,  
Have a nice day,

P.S: Here the folder size stats:

```julia-auto
$ du -sh .julia/* | sort -h
4.0K .julia/clones
4.0K .julia/datadeps
80K .julia/environments
112K .julia/logs
8.1M .julia/scratchspaces
9.4M .julia/registries
631M .julia/packages
991M .julia/juliaup
3.0G .julia/artifacts
7.7G .julia/compiled

```

---

<div class="post-metadata">

**Author:** ![mgkuhn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mgkuhn/32/6276_2.png) [@mgkuhn](https://discourse.julialang.org/u/mgkuhn)\
**Post date:** [August 28, 2025, 7:06am UTC](https://discourse.julialang.org/t/which-files-to-backup-in-julia/131906/2 "2025-08-28T07:06:41Z")

</div>

I only backup `.julia/dev`. Because that’s where files reside that I edited. I think of all the other folders in `.julia` as just caches that Julia can quickly recreate from scratch when you instantiate your projects.

In fact I define the environment variable JULIA\_PKG\_DEVDIR to point to a location that is backed up, and I point JULIA\_DEPOT\_PATH and JULIAUP\_DEPOT\_PATH to a location that is not.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [August 28, 2025, 7:15am UTC](https://discourse.julialang.org/t/which-files-to-backup-in-julia/131906/3 "2025-08-28T07:15:06Z")

</div>

> [@mgkuhn](#):
>
> I only backup `.julia/dev`.

Well, to have a backup of `.julia/environments` is also a good idea. And a backup of your `startup.jl` file, if you are using it.

---

<div class="post-metadata">

**Author:** ![mgkuhn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mgkuhn/32/6276_2.png) [@mgkuhn](https://discourse.julialang.org/u/mgkuhn)\
**Post date:** [August 28, 2025, 7:19am UTC](https://discourse.julialang.org/t/which-files-to-backup-in-julia/131906/4 "2025-08-28T07:19:08Z")

</div>

I barely use `.julia/environments`. I always call `julia --project` to use it with a local per-project environment.

---

<div class="post-metadata">

**Author:** ![hadrien.theveneau](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hadrien.theveneau/32/218699_2.png) [@hadrien.theveneau](https://discourse.julialang.org/u/hadrien.theveneau)\
**Post date:** [August 28, 2025, 9:37am UTC](https://discourse.julialang.org/t/which-files-to-backup-in-julia/131906/5 "2025-08-28T09:37:14Z")

</div>

Many thanks for all your answers. I think I will explicitely exclude the big dirs, but include in my backups all the other stuff.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [August 28, 2025, 11:37am UTC](https://discourse.julialang.org/t/which-files-to-backup-in-julia/131906/6 "2025-08-28T11:37:33Z")

</div>

If you don’t want to erase the whole `.julia` folder, but still need to clean things up every now and then, use [GitHub - giordano/PkgCleanup.jl: Cleanup unused Julia environments and artifacts](https://github.com/giordano/PkgCleanup.jl)

I wish Julia itself had a `] cleanup` command, and that `juliaup` erased all artifacts that were built in versions that are no longer installed.

Related: [How to cleanup artifacts folder](https://discourse.julialang.org/t/how-to-cleanup-artifacts-folder/101277)

---

<div class="post-metadata">

**Author:** ![hadrien.theveneau](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hadrien.theveneau/32/218699_2.png) [@hadrien.theveneau](https://discourse.julialang.org/u/hadrien.theveneau)\
**Post date:** [August 28, 2025, 4:00pm UTC](https://discourse.julialang.org/t/which-files-to-backup-in-julia/131906/7 "2025-08-28T16:00:36Z")

</div>

Not yet but I will definitely have a look on PkgCleanup. Thanks.
