# Istio Documentation - Local Build and Deploy

[Istio](https://istio.io/latest/) is the most popular [service mesh](https://istio.io/latest/about/service-mesh/#what-is-a-service-mesh) in the industry today. It is backed by a comprehensive documentation hosted at [https://istio.io/latest/docs/](https://istio.io/latest/docs/)

Like any open source project, Istio's documentation relies heavily on the contributions from the community. If you are passionate about documentation and would like to make a contribution, the first step is to set up the documentation site locally. In this article, we will learn the basic steps to achieve this.

## Prerequisites

* [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
    
* [Docker Desktop](https://docs.docker.com/desktop/)
    

## Local Setup

### Fork the repository

Create a [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) of the [istio/istio.io](https://github.com/istio/istio.io) repository

### Clone the fork

<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Use the url of your forked repo</div>
</div>

```bash
git clone https://github.com/adityasamant25/istio.io
```

### Create a branch

<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">'issue-10' has been used as an example for the branch name</div>
</div>

```bash
// Navigate to the project directory
cd istio.io
git checkout -b issue-10
```

### Deploy the website locally

Istio provides a Docker image with all the tools needed, including `Hugo` which is the site generator. To build and publish the website locally within the docker container, execute the command below:

```bash
make serve
```

<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">In case you receive an error stating <em>"Failed to read Git log: fatal: detected dubious ownership in repository at '/work'"</em>, execute the below command locally and then run the <code>make serve</code> command again.</div>
</div>

```bash
git config --global --add safe.directory /work
```

Once the website builds successfully, you should see the following message:

```plaintext
Built in 18037 ms
Environment: "development"
Serving pages from disk
Web Server is available at http://localhost:1313/latest/ (bind address 0.0.0.0) 
```

Access the URL [http://localhost:1313/latest/](http://localhost:1313/latest/) from within a browser. The Istio documentation is now available to you locally.

### Contribute changes

The documentation for the English language is available at the following path:

```plaintext
/content/en/docs
```

Navigate to the .md file you need to edit. Make the appropriate changes and save the file. Saving the changes automatically triggers a redeployment of the site. The browser refreshes automatically and this enables you to immediately validate your changes locally.

Once you are satisfied with your changes, perform the following steps:

* Commit the changes to your local branch
    
    ```bash
    git add <file paths>
    git commit -m "Fixed issue 10"
    ```
    
* Push the changes to a branch on your fork
    
    ```plaintext
    git push origin issue-10
    ```
    
* Raise a pull request from your branch to the istio.io master branch
    

After you raise a pull request, wait for a maintainer to review the changes. In case of any review comments, incorporate the changes and push a new commit.

## Conclusion

Hope this article helps in getting you started on your journey to contribute to Istio documentation. In case of any issues, please post a reply and I will try to assist.
