I'm looking for a way to turn OFF autosave in iPython notebook. I've seen references via Google/Stack Overflow searches on how to turn ON autosave but I want the opposite (to turn OFF autosave). It would be preferential if this was something that could be set permanently rather than at the top of each notebook.
-
I have tried all the solutions given to your question. None of them works (for me). When starting a new PY file, Notebook creates an 'Untitled.ipynb' file from the 1st second and continues update it. Have you finally found a workable solution? – Apostolos Aug 26 '18 at 09:42
-
1@Apostolos - note the accepted solution is outdated. You can try the newer solutions [below](https://stackoverflow.com/a/54276982/8425408). – OmerB Jan 21 '19 at 07:46
-
Thanks. I have solved the issue. – Apostolos Jan 22 '19 at 08:53
7 Answers
This will disable autosave once you're in IPython Notebook in the browser: %autosave 0
.
Update: There is now a UI feature in JupyterLab: https://github.com/jupyterlab/jupyterlab/pull/3734

- 509
- 1
- 3
- 4
-
3I have come across that command before but is there a way to turn off autosave permanently in iPython? Otherwise, I'd have to go and add "%autosave 0" to all of my notebooks. – slaw Sep 12 '14 at 14:07
-
Perfect for me. I'm using `%%javascript` and for some reason Jupyter executes the js cells everytime it autosaves, which can be annoying when dealing with lots of data and `console.log`ing it to the browser console. – tmthyjames May 25 '16 at 18:04
-
-
1**% autosave 0** works only with Python kernel. It throws an error message, when I use either C++ (Xeus) or Java (iJava) kernel. – Seshadri R Jul 19 '18 at 12:43
If you add this to your custom.js
, it will disable autosave for all notebooks:
$([IPython.events]).on("notebook_loaded.Notebook", function () {
IPython.notebook.set_autosave_interval(0);
});
custom.js
is found at $(ipython locate profile)/static/custom/custom.js
. You can use the same thing to increase or decrease the autosave interval. The value is in milliseconds, so an interval of 30000 means autosave every thirty seconds.

- 37,545
- 9
- 92
- 87
The original solution from MinRK is outdated, partly because IPython/Jupyter keeps changing so much. I can't find proper documentation for this, other than an indirect reference here, but according to this forum post, the solution now seems to be to edit or create the file ~/.jupyter/custom/custom.js
, and add the line:
Jupyter.notebook.set_autosave_interval(0); // disable autosave
This works for me. You can confirm if it works by looking for the brief "Autosave disabled" box in the top right corner of the Jupyter notebook on startup. The full solution in the forum post did not work for me, probably because it is no longer completely valid, and errors in the custom.js file seem to occur silently.

- 2,921
- 1
- 15
- 9
-
1I am using Jupyter 4.4 on High Sierra. There is no directory called **custom** beneath **~/.jupyter**. In fact, there are not any directory entries below **~/.jupyter** – Seshadri R Jul 19 '18 at 12:39
-
Indeed, there's no such a path and I wonder how can you suggest a solution based on inexistent data. Anyway, I created a 'custom.js' in that exact path and added the line you suggested. Anyway, I can't test it because I don't think Jupyter NB reads custom.js file in the first place. – Apostolos Aug 26 '18 at 17:03
-
-
2@Apostolos, "Indeed, there's no such a path and I wonder how can you suggest a solution based on inexistent data". I wonder about your wondering. Either the path already existed for me, or if not, I did the next logical thing and created an empty folder named `custom`. – Martin Spacek Oct 23 '18 at 09:28
-
I had to embed this into a require statement -- left another solution below. – Mark Chackerian Jun 05 '19 at 16:40
Step-by-Step solution for Jupyter Notebook 5.5.0 on Windows (will probably work for other envs/versions as well)
Find the Jupyter configuration folder:
from jupyter_core.paths import jupyter_config_dir jupyter_dir = jupyter_config_dir() # C:\users\<user_name>\.jupyter on my machine
create sub-folder
custom
, and create filecustom.js
within it:i.e. 'C:\users\<user_name>\.jupyter\custom\custom.js'
Put the following line in custom.js:
IPython.notebook.set_autosave_interval(0);
Save file and restart the Jupyter Notebook server (main app).
When opening a notebook you should see "Autosave disabled" briefly appearing in the right side of the menu bar:

- 4,134
- 3
- 20
- 33
-
1Thanks for the detailed instruction. This worked for me on Jupyter notebook v6.0.3 with IPython 7.16.1 on Windows. – BioData41 Jun 10 '21 at 12:50
Edit: The autosave interval on notebook load does not appear to work any more in recent version of Jupyter Notebook (jupyter notebook --version
at 6.0.1
). So I'm back to the custom.js
solution:
mkdir -p ~/.jupyter/custom
echo "Jupyter.notebook.set_autosave_interval(0);" >> ~/.jupyter/custom/custom.js
As pointed out by Thomas Maloney above, JupyterLab now has a command for that (Uncheck Autosave Documents in the Settings menu).
In Jupyter Notebook, I think the autosavetime
extension is easier to use than the custom.js
file. The autosavetime
extension is part of the Jupyter notebook extensions and can be installed with
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install
jupyter nbextension enable autosavetime/main
Once it is installed, restart jupyter notebook
and go to nbextensions_config in the Edit menu. Select the autosavetime
extension, and turn off autosave as follows:
- check the box Set an autosave interval on notebook load. If false, the default is unchanged.,
- enter 0 for Autosave interval (in minutes) which would be set on notebook load.
To test the modification: open or create a Python notebook and execute, in a new cell,
%%javascript
element.text(Jupyter.notebook.autosave_interval);
If the result is 0, you have successfully turned the autosave off. Congratulations!

- 669
- 6
- 8
-
Is there a way to change the `Autosave interval` setting of this extension without restarting the jupyter notebook server? – Louis Yang Oct 03 '19 at 20:16
-
I don't this you're supposed to restart the server for this setting to take effect. Unfortunately, I was not able to test it myself: as mentioned in the edit, that part of the extension stopped working with recent versions of Jupyter Notebook. – Marc Wouts Oct 15 '19 at 04:32
-
The `autosave` extension works (jupyter notebook 6.5.2 here), but the notebook will always open with the default value, and you need to manually go in the menu and trigger the extension by changing the value (and it won't trigger if you select the same value that was already there). Instead the `custom.js` solution works flawlessly and always open the notebook with the value you set in that file. Thank you so much! – robertspierre Nov 22 '22 at 15:32
As of Jupyter 4.4 (2019), a working solution is to add this to your custom.js file:
require(['base/js/namespace', 'base/js/events'], function (Jupyter, events) {
Jupyter.notebook.set_autosave_interval(0);
console.log("Auto-save has been disabled.");
});
Without the require
block the javascript will execute prior to the Jupyter
object being available, resulting in an error.
Just to be clear, custom.js should reside at ~/.jupyter/custom/custom.js -- you must create the custom
directory if it does not exist.

- 21,866
- 6
- 108
- 99
-
This worked for me with Jupyter 6.2.0 on macOS Catalina. Make sure you create `~/.jupyter/custom/custom.js` if it doesn't exist. Then stop and restart `jupyter notebook`. – ChalkBoard Feb 09 '21 at 15:42
-
Sadly this didn't work in my hands. Tried it with JupyterLab V4.0.2 as implemented in the Docker image `jupyter/scipy-notebook:hub-3.1.1`, image ID 97dfb7608620 – András Aszódi Jul 07 '23 at 16:09
For Jupyter Notebook 7 (2023) now shares underlying extension system as JupyterLab. To disable the autosave programmatically, you can edit the lab settings in ~/.jupyter/lab/user-settings/@jupyterlab/docmanager-extension/plugin.jupyterlab-settings
{
"autosave": false
}
On a related note, if you need to autosave faster than the default 120s, for example every 1s, you can configure the same file as follows:
{
"autosave": true,
"autosaveInterval": 1,
}

- 2,519
- 2
- 15
- 24