# 4.1.2 Install OpenCRVS locally

{% embed url="https://www.youtube.com/watch?ab_channel=OpenCRVS&feature=youtu.be&v=q-bO42USMUw" %}

The following instructions will guide you on how to set up a local, demo development environment of OpenCRVS using our fictional country configuration: "Farajaland".

1. Check you have installed all the dependencies in the previous section
2. Clone OpenCRVS Core:

```
git clone git@github.com:opencrvs/opencrvs-core.git
```

3. Navigate inside the core directory

```
cd opencrvs-core
```

4. Ensure that you are on the master branch. The master branch is always aligned to the latest release.

```
git checkout develop
```

5. Run the setup command

```
bash setup.sh
```

{% hint style="warning" %}
Do not use **`sudo bash setup.sh`**!

Many Ubuntu developers get into a bad habit of using **sudo** before every command.

The `bash setup.sh` command needs to set folder permissions for Elasticsearch and Docker. If you use sudo, the owner of the /data folder becomes root. You will encounter permissions problems that are hard to debug.
{% endhint %}

This installer script will:

* Test that your dependencies are installed correctly
* Checks that required ports are available. **Note:** MacOS runs AirPlay on port 5000. Mac users need to disable AirPlay in System Preferences in order to run OpenCRVS.
* Download and install all Docker images
* Check out the example OpenCRVS country configuration repository in a directory alongside opencrvs-core: [https://github.com/opencrvs/opencrvs-countryconfig](https://github.com/opencrvs/opencrvs-countryconfig)
* Runs all OpenCRVS Core microservices
* Run the OpenCRVS country configuration repository with test data from our fictional country, "Farajaland" and populate local databases with Farajaland reference data

6\. If there are any missing dependencies the script will exit and display instructions. Once the dependency is satisfied, you can try again.

7\. On completion you will see the OpenCRVS logo

<figure><img src="https://3067259618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fesn2q91OsFQf7ZqR8thb%2Fuploads%2Fgit-blob-9f9befc64de333039c2e83cf176787843d5682aa%2FScreenshot%202024-01-16%20at%2014.36.58.png?alt=media" alt=""><figcaption></figcaption></figure>

* Open the url [**`http://localhost:3020/`**](http://localhost:3020/)
* You have successfully installed OpenCRVS! 🎉
* Proceed to login using the details in the [section 3.14 Log in to OpenCRVS](3.1.4-log-in-to-opencrvs-locally).
* To stop OpenCRVS running in the installer, type **ctrl+c**, then **exit** in each tmux terminal window

<figure><img src="https://3067259618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fesn2q91OsFQf7ZqR8thb%2Fuploads%2Fgit-blob-e6fa93d0c87b1ea7bf7487a2b81d53cc1053882c%2FScreenshot%202024-01-16%20at%2014.38.14.png?alt=media" alt=""><figcaption></figcaption></figure>
