Blog

GrandNode and MongoDB in a 3 minutes - the fastest installation with Docker

Wednesday, March 21, 2018 Comments (8)

Few days ago I described you how to create a DigitalOcean droplets and how to install GrandNode and MongoDB with Docker on them. It was easy way, but you need to spend some time with it. Today, I will show you how to install GrandNode and MongoDB just in a 3 minutes. It's one of the fastest way to install GrandNode!

How to create an account and Droplet?

It's very simple process. I've described it in our earlier tutorial. You can check it here. 

How to install GrandNode?

Now let's begin the journey. In the previous tutorial, you learned how to install GrandNode and MongoDB in different droplets. It was easy, but you need to make some customizations to secure your mongodb. Today I will show you how to create a single droplet with multiple docker containers. 

Please login to your DigitalOcean droplet with your new account. Please remember to install Droplet with One-Click app - Docker. It's required! 

If you installed your droplet, open the cmd or console and let's start the installation process. Use the following command to install MongoDB on your server. 

docker run -d -p 127.0.0.1:27017:27017 --name mongodb mongo

Docker run MongoDB

It will pull the newest image of mongo. 

Now let's install GrandNode and link it to installed MongoDB.

docker run -d -p 80:80 --name grandnode --link mongodb:mongo grandnode/release_4.10

Docker run GrandNode

Where grandnode is the name of your container, you can name it by yourself and where mongodb is a name of your mongodb container.

And that's all. Open the website with the droplets IP and install GrandNode. During installation, as the name of MongoDB server use the name of your mongodb container (in my case it's mongodb).

It's really one of the simplest and the fastest way of installing GrandNode. 

Leave your comment

avatar

I like the tutorial. I have successfully installed. But i want to copy code from local to docker container. I have a problem:
- Command line "docker cp" cannot copy file to host and return message "Could not find the file [path] in container [container_name]".
Can anyone support me?
Many Thanks,

avatar

Hi Duy,

docker cp command is used to copy files from host to container. Probably you are trying to copy file from local computer to host, what's impossible to do.

avatar

Hello, i was trying to run grand node via docker on windows 10
i have followed all instructions here

and i have image running on docker but when i navigate to 127.0.0.0.1:8080 as mentioned
i get no response i have also tried other ips like local ip of listed from ipconfig command but in vain ,any help?

avatar

Hello Hassan,

What did you set in the docker run command? If you want to run it locally, you should use for example:
127.0.0.1:8080:80

If you used something different, you won't be able to connect with it.

You can also look at this article. It may be useful for you:
https://grandnode.com/weekly-tips-4-build-and-run-the-grandnode-with-docker-for-linux-containers

Best,
Patryk

avatar

great tool.  docs are helpful (including the write up on this page).  I needed to change the port so I ran
"docker rm <my name>"
//which stopped and removed the instance of GN
//then i ran
"docker run -d -p 127.0.0.1:<my new port>:80 --name <reused the same name for my last GN instance> --link <the existing mongo instance with data I setup a few minutes ago and want to keep>:mongo grandnode/release_4.20"
// but now I am taken to the install page which give me an error that a mongo DB already exists...  how to connect to an exiting DB?  I get this 'This database already exists and has GrandNode installed on it. Choose different database.'  Any advice on how to connect a new GN web server instance to an existing mongo db instance?

avatar

**how to connect to an existing DB?
//typo

avatar

it means that you've already installed GrandNode inside this database. So you need change the database name or modify Settings.txt file inside App_Data directory in your GrandNode.

avatar

I have an issue in first step in your tutorial:
https://grandnode.com/grandnode-and-mongodb-in-a-3-minutes-the-fastest-installation-with-docker
When I try to excuse this command:
docker run -d -p 127.0.0.1:27017:27017 --name mongodb mongo
it says:
"docker run" requires at least 1 argument.
See 'docker run --help'.
Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
Run a command in a new container

Any suggestion?