# Donwload Cosmos and Build and run your own Official Cosmos-Docker-Container locally

**URL:** <https://forum.cosmos.network/t/donwload-cosmos-and-build-and-run-your-own-official-cosmos-docker-container-locally/1283>\
**Category:** Validation\
**Created:** [November 5, 2018, 4:41pm UTC](https://forum.cosmos.network/t/donwload-cosmos-and-build-and-run-your-own-official-cosmos-docker-container-locally/1283 "2018-11-05T16:41:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![melea-trust](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.cosmos.network/melea-trust/32/90_2.png) [@melea-trust](https://forum.cosmos.network/u/melea-trust)\
**Post date:** [November 5, 2018, 4:41pm UTC](https://forum.cosmos.network/t/donwload-cosmos-and-build-and-run-your-own-official-cosmos-docker-container-locally/1283/1 "2018-11-05T16:41:38Z")

</div>

Hello, in this way we can download the official Cosmos repo and build the Docker container for run locally.

if want to Upload to the Docker-Hub your own image, for run in any server without having to build = [Build Cosmos Docker and upload to Docker-Hub for run in any machine](https://forum.cosmos.network/t/build-cosmos-docker-and-upload-to-docker-hub-for-run-in-any-machine/1284)  
Here the link for running my own image from any machine.  
[https://forum.cosmos.network/t/run-cosmos-with-docker-2-cmd-no-need-install-cosmos](https://forum.cosmos.network/t/run-cosmos-with-docker-2-cmd-no-need-install-cosmos)

Ok, let’s start.

#If need install docker and Goland 😉 Start here.  
#Install go

```auto
wget -c 'https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz' -O go1.10.3.linux-amd64.tar.gz

```

```auto
sudo tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz

```

```auto
sudo rm -Rf go1.10.3.linux-amd64.tar.gz

```

#Set gopath

```auto
 vi $HOME/.profile

```

#Add this lines to your file:  
PATH=“$PATH:/usr/local/go/bin”  
GOPATH=“$HOME/go”  
PATH=“$PATH:$GOROOT/bin:$GOPATH/bin”

#reload profile

```auto
source $HOME/.profile

```

```auto
go version

```

#$: go version go1.10.3 linux/amd64

Step 2

#Install Docker

```auto
 sudo apt-get update
 curl -fsSL get.docker.com -o get-docker.sh
 sh get-docker.sh
 sh install.sh

```

Add your user to Docker Group

```auto
 sudo usermod -aG docker $(whoami)

```

Now that Goland and Docker is installed, just Download Cosmos Official repo.

go get [GitHub - cosmos/cosmos-sdk: ⛓ A Framework for Building High Value Public Blockchains ✨](http://github.com/cosmos/cosmos-sdk)

cd go/src/github.com/cosmos/cosmos-sdk

#Build the Docker-Cosmos locally in the server

docker build -t gaia .

Now can run Docker Cosmos Locally (only in your server after build)

CMD#1=

```auto
docker run -it -p 26657:26657 -p 26656:26656 -v ~/.gaiad:/root/.gaiad -v ~/.gaiacli:/root/.gaiacli gaia gaiad init --name VALIDATORIAN-NAME

```

#Lets add the seed and the persistent peer for Sync gaia-8001

```auto
cd .gaiad/config

```

#If -bash: cd: data: Permission denied =

```auto
sudo chown user:group data

```

#Remove default genesis file and down the good for gaia-8001. (today)

```auto
rm genesis.json

```

Download the Good genesis.json

```auto
wget -c 'https://raw.githubusercontent.com/cosmos/testnets/master/gaia-8001/genesis.json '

```

#Add seed nodes and persistent peers to config.toml and verify your Validatorian name is ok.

```auto
vi config.toml

```

```auto
seeds = "7c8b8fd03577cd4817f5be1f03d506f879df98d8@gaia-seed1.interblock.io:26656, a28737ff02391a6e00a1d3b79befd57e68e8264c@gaia-seed2.interblock.io:26656, 987ffd26640cd03d08ed7e53b24dfaa7956e612d@gaia-seed3.interblock.io:26656,837ab35ee80e6882da08ab6244ef27538e73aedd@gaia-seed4.interblock.io:26656"

```

CMD#2=

```auto
docker run -it -p 26657:26657 -p 26656:26656 -v ~/.gaiad:/root/.gaiad -v ~/.gaiacli:/root/.gaiacli gaia gaiad start

```

#Ok here is running the Cosmos Gaia-8001, Salut!

Summary

Start cosmos docker

```auto
docker run -it -p 26657:26657 -p 26656:26656 -v ~/.gaiad:/root/.gaiad -v ~/.gaiacli:/root/.gaiacli meleatrust/get-cosmos:part024 gaiad init --name VALIDATORIAN-NAME

```

```auto
cd .gaiad/data

```

#If -bash: cd: data: Permission denied = sudo chown user:group data

#Add seed nodes and persistent peers to config.toml and verify your Validatorian name is ok.

```auto
vi config.toml

```

```auto
docker run -it -p 26657:26657 -p 26656:26656 -v ~/.gaiad:/root/.gaiad -v ~/.gaiacli:/root/.gaiacli gaia gaiad start

```

#for close gaia

CRTL+C

#for run in Detached mode

```auto
docker run -it -d -p 26657:26657 -p 26656:26656 -v ~/.gaiad:/root/.gaiad -v ~/.gaiacli:/root/.gaiacli gaia gaiad start

```

#For stop the gaia in detached mode

```auto
docker container ls

```

```auto
docker stop (CONTAINER ID from gaia)

```

Here one Back up file and instructions for sync the block +900k

> [@Build a node and sync from block 900k gaia-8001 (backup file)](https://forum.cosmos.network/t/build-a-node-and-sync-from-block-900k-gaia-8001-backup-file/730):
>
> hello, i just made a backup file and the steps for sync from block +900k. in gaia -8001 Build the node first Time like= #Install go wget -c 'https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz' -O go1.10.3.linux-amd64.tar.gz sudo tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz sudo rm -Rf go1.10.3.linux-amd64.tar.gz #Set gopath vi $HOME/.profile #Add this lines to your file: PATH="$PATH:/usr/local/go/bin" GOPATH="$HOME/go" PATH="$PATH:$GOROOT/bin:$GOPATH/bin" #reload profile source…

Enjoy, more docker cmd comings later

🙂 post under constructions but verify for now is working ok. just need to add more cmd.  
cheers 🤗
