# Getting started

## On this page:

1. [Linux/MacOS](/cee-5735/fenics/docker.md#linux-mac)
2. [Windows](/cee-5735/fenics/docker.md#windows)
3. [Ubuntu](/cee-5735/fenics/docker.md#ubuntu)

## Linux/Mac

#### Using Anaconda (Recommended)

The easiest way to use FEniCS is by creating and activating a conda environment containing the FEniCS package:

```
conda create -n fenicsproject -c conda-forge fenics
source activate fenicsproject
```

#### Using Docker

Another way is to download the FEniCS Docker image and set up a Docker container. Please note that there are additional steps if you wish to use Jupyter Notebook inside a Docker container.&#x20;

Installing Docker is pretty straightforward on MacOS:

{% embed url="<https://docs.docker.com/docker-for-mac/install/>" %}

After installing Docker, download the FEniCS Docker image from your terminal:&#x20;

```
curl -s https://get.fenicsproject.org | bash
```

Using this image, create a container named *fenics-container* (or name it however you like) that shares files with your local directory:

```
docker run -ti -v $(pwd):/home/fenics/shared --name fenics-container -p 127.0.0.1:8000:8000 quay.io/fenicsproject/stable
```

Navigate to your desired local directory and start the Docker container:

```
docker start fenics-container
docker exec -ti -u fenics fenics-container /bin/bash -l
```

This is what you can expect on your terminal. Notice that the *shared* directory in the container shares the same files as your local directory.&#x20;

![](/files/-MMWbhiR7OD_wM7lv-W0)

Run your python scripts normally using *python3*. When you are finished, first exit the container using *exit,* then stop the Docker container:

```
docker stop fenics-container
```

## Windows

#### **Using Docker**

Docker for Windows requires Windows 10 [Pro/Enterprise/Education ](https://docs.docker.com/docker-for-windows/install/)or [Home](https://docs.docker.com/docker-for-windows/install-windows-home/). After installation, follow the steps above to create a FEniCS container. Docker for Windows can be a bit finicky since it uses Hyper-V or WSL2 to run the Linux images. If you've tried this installation and failed, I would recommend using Ubuntu.

#### **Using Ubuntu (Recommended)**

There are many ways to use Ubuntu on a Windows PC (via virtual machine, dual booting, cloud, etc.). If you don't have a preference, I would recommend setting up an Ubuntu virtual machine.&#x20;

First install Virtualbox:

{% embed url="<https://www.virtualbox.org/wiki/Downloads>" %}

Then follow these instructions to set up a Ubuntu virtual machine:

{% embed url="<https://www.cs.unm.edu/~bradykey/ubuntuVMInstallGuide.html>" %}

Finally, install FEniCS on the Ubuntu VM using the instructions in the Ubuntu section.&#x20;

## Ubuntu

Install FEniCS by running this on the terminal:

```
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:fenics-packages/fenics
sudo apt-get update
sudo apt-get install --no-install-recommends fenics
```

{% hint style="warning" %}
If line 4 fails, try running lines 3 and 4 again.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hs764.gitbook.io/cee-5735/fenics/docker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
