# Run a Jupyter notebook and keep your work

You will run a notebook on a rented GPU and then learn which of your files survive, and how to copy them to a place you control. A server's disk is not a backup, so this part matters as much as the code.

## 1. Start a notebook server

If you did [Your first GPU server](/docs/tutorial-first-gpu-server), use that server. Otherwise open **Deploy**, pick a GPU with **VRAM** of 8 GB or more, select the **Notebooks** filter above the template cards, select **PyTorch + JupyterLab** and request the server. If you also select an SSH key on the configure step, you can copy files with `scp` later.

When the status is **Running**, open the server, select the **Connect** tab and select **Open Jupyter**.

## 2. Run something on the GPU

In JupyterLab, select **Python 3 (ipykernel)** under **Notebook**. Run this in the first cell:

```python
import time
import torch

x = torch.randn(8192, 8192, device="cuda")
torch.cuda.synchronize()
start = time.time()
y = x @ x
torch.cuda.synchronize()
print(f"{time.time() - start:.4f} s on", torch.cuda.get_device_name(0))
```

It prints the time of one large matrix multiplication and the GPU name. Your number depends on the GPU. In a second cell, save a small result next to the notebook and list the folder:

```python
torch.save(y[:4, :4].cpu(), "/workspace/sample.pt")
!ls -lh /workspace
```

You should see `sample.pt` in the list. Press Ctrl+S to save the notebook. The file browser on the left starts in `/workspace`, so your notebooks are saved there too. Right-click the notebook in the file browser and choose **Rename** to give it a better name.

## 3. Install what you need

In a cell, `%pip install pandas` adds a package. Packages are installed in the server's system, not in `/workspace`. A hard reboot keeps them, but **Destroy** and **Recreate container** erase everything on the server, `/workspace` included. Keep a `requirements.txt` with your notebooks off the server (on a volume or your own computer), copy it to a new server and run `%pip install -r /workspace/requirements.txt`.

## 4. See what survives a stop

1. Open the server's page and select **Stop**, then **Stop server**.
2. When it shows **Stopped**, select **Start**.
3. Open the **Connect** tab and select **Open Jupyter** again. The address can change after a start.

Your notebook and `sample.pt` are still in the file browser. The disk is kept while the server is stopped. It is deleted when you destroy the server, and when the host's rental period ends. See [Storage and data](/docs/storage-and-data).

## 5. Keep your work

Do at least one of these before you destroy the server:

- **Download from the browser.** In the file browser, right-click a file and choose **Download**. For a folder, make an archive in a cell first with `!tar -czf /workspace/project.tar.gz -C /workspace my-project`, then download that file.
- **Copy with scp.** On your own computer, with `PORT` and `HOST` from the **Connect** tab:

```bash
scp -P PORT root@HOST:/workspace/project.tar.gz ./
```

- **Back up to your own bucket.** A helper script copies a folder to any S3-compatible storage. See [Back up to your own storage](/docs/backups).

More methods are compared in [Moving data](/docs/data-movement).

> [!WARNING]
> Anyone who has the access token can run code on your server, and the page is plain `http`. Do not share the address, and do not put secrets in the notebook.

## When you are done: stop or delete

- **Stop** ends the compute charge and keeps the disk, which is still charged. Use it for a break.
- **Destroy** ends every charge and deletes the disk. Use it when your files are safe elsewhere. Open the server, go to **Settings**, select **Destroy server** and type the server name.

## Next

- [Fine-tune a small model](/docs/tutorial-fine-tune-a-model)
- [Move data in and out](/docs/tutorial-move-data)
