If there something else running on port 8888 on your device and you want to run Jupyter Notebook on a different port, then you can achieve this by adding a --port option when you start the notebook and provide the port number.
Example 1: Using --port option
% python3 -m notebook --port 8090
[I 2023-07-26 04:08:37.147 ServerApp] nbclassic | extension was successfully loaded.
[I 2023-07-26 04:08:37.148 ServerApp] notebook | extension was successfully loaded.
[I 2023-07-26 04:08:37.149 ServerApp] Serving notebooks from local directory: /Users/c2ctechtv
[I 2023-07-26 04:08:37.149 ServerApp] Jupyter Server 2.7.0 is running at:
[I 2023-07-26 04:08:37.149 ServerApp] http://localhost:8090/tree?token=e48e77a117b35251c216e87fdde6841fbb638f4405078d6c
[I 2023-07-26 04:08:37.149 ServerApp] http://127.0.0.1:8090/tree?token=e48e77a117b35251c216e87fdde6841fbb638f4405078d6c
[I 2023-07-26 04:08:37.149 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
As you can see that the server started at localhost port 8090 as I wanted.
Example 2: Using the Jupyter Notebook Config File
If you want to change the default port permanently then it is better to go and modify the Jupyter Notebook Config File.
You can do that by modifying or creating a file named jupyter_notebook_config.py under your home ~/.jupyter folder.
c.NotebookApp.port = 8090
-
If you want to change the default port permanently then it is better to go and modify the Jupyter Notebook Config File.
You can do that by modifying or creating a file named jupyter_notebook_config.py under your home ~/.jupyter folder.
c.NotebookApp.port = 8090

Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to Python,
- Python: Convert Date to DateTime
- How to sort a List using Lambda in Python
- Python matplotlib segmentation fault: 11 macOS Big Sur
- What is Terminal Velocity and its Formula? How to calculate it programmatically?
- How to install Python 3.11 on Mac
- How to flatten a nested list in Python
- Python: Pandas Merge DataFrames on Index Example
- How to Run all Cells at Once Jupyter Notebook
- Python - Convert float to String
- How to add borders to tkinter label text
- How to Exit a Loop in Python Code
- [Python] Fix: ValueError: All arrays must be of the same length
- Sorting an array using Bubble Sort in Python Programming
- How to Unzip a file using Python
- Python: Merge DataFrames Pandas Outer Join Example
- Change label (text) color in tkinter
- Convert Float to String in Python
- Fix: fatal error: No such file or directory compilation terminated
- Python: Access index/counter of a for loop iteration
- Import Other Python Files Examples
- How to install Anaconda on Mac (M1/M2 Mac)
- Python Regular Expression to Find All Matches in List
- How to Read a binary File with Python
- How to disable warnings while Python file execution
- Know current Python Version
More Posts:
- Free Unlimited Calls from MTNL & BSNL Landlines from 1st May 2015 - HowTos
- How to make EditText text to uppercase or lowercase on macOS - MacOS
- Auto Execute a command or script on Mac Terminal Startup - MacOS
- [Nopepad++] How to add text at end of each line - NotepadPlusPlus
- Simple Struts 2 Tutorial in eclipse with tomcat 7 server - Java
- Android Images with Rounded Corners : ImageView - Android
- Fix MySQL ERROR 1045 (28000): Access denied for user root@localhost (using password: YES) - MySQL
- List of 32 CSS cursors web developers must know about - CSS