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
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
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.
Comments
Duy
- 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,
Patryk
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.
Hassan
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?
Patryk
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
Ab
"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?
Ab
//typo
Patryk
Mohamed
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?