Do you need Technical Assistance ?

If you come from a non-tech background and need help. Feel free to ask for help on our forum or call us at +91-8688667928 for Paid Support Options

Quick Installation Using Docker

Prerequisite Knowledge

If you are completely new to Cloud hosting then you can learn it in just few minutes with these simple tutorials.

https://www.digitalocean.com/docs/droplets/how-to/create/
https://www.digitalocean.com/docs/droplets/how-to/connect-with-ssh/

We assume some familiarity with Ubuntu terminal commands and cloud hosting. If you completely new to this you can follow tutorials like these

http://www.linuxandubuntu.com/home/10-basic-linux-commands-that-every-linux-newbies-should-remember

Steps for Installation

Step 1: Install docker and docker compose
Step 2: Download Docker file and run it
Step 3 : Assign a Domain name
Step 4 : Enter container and update instance configuration
Step 5 : Publish your app on Google Play (Optional)
Step 6 : Submit your market to Nearby Shops (Optional)
Step 7 : Login as admin and update Market Configuration

We have already tested this guide on Digital Ocean One-Click Docker Image. So For simplicity and ease of Installation we recommend Digital Ocean. To get started you can create a new Droplet using One Click Docker Image given here https://marketplace.digitalocean.com/apps/docker This image comes with Docker preinstalled. So you dont have to install docker manually.

Please Note : We recommend Digital Ocean for simplicity but you can use any other cloud hosting platform. We are assuming that you are installing on a ubuntu based cloud server with an IP address & internet access.

Step 1: Install docker and docker compose

If you already have docker preinstalled then you can skip this step.

If you dont have latest version of docker and docker compose please install them using the following official installation guides.

Install the latest version of docker using this link https://docs.docker.com/install/linux/docker-ce/ubuntu/
Install the latest version of docker Compose using this link https://docs.docker.com/compose/install/

Step 2: Download Docker Compose file and run it

Download the docker compose file and run it.

                     Commands
                  
    cd ~
    mkdir nearbyshops
    cd nearbyshops

    wget https://raw.githubusercontent.com/NearbyShops/Nearby-Shops-Android-app/master/docker-compose.yml

    docker-compose up

    (Exit container using Ctrl + C or Ctrl + Z  ... If nothing works close the terminal window & start a new terminal)
      
                

This is optional. You can also edit the docker-compose.yml file and change the settings like port number, container name to suit your needs.

                    Optional Commands
                  
    sudo nano docker-compose.yml
                
                

Verify Successful Execution : In order to verify and test that we have a successful connection to the Api Server. We will test the endpoints to see if we get any result.

Before testing the endpoints please ensure that your container is running.

                    Terminal Commands
                  

    docker-compose start
    (please ensure that you are inside the directory where docker-compose.yml resides)

    OR 

    docker start nbs_api_container     
                
                

The url for the endpoint is
[IP:port]
Replace the IP and port number according to your installation. For example if your IP address is 139.59.81.21 and port number is 80 you can type some like 139.59.81.21 in URL of Firefox or Chrome browser.

If you see a login screen of an admin dashboard. Having the output verifies successful execution.

Step 3 : Assign a Domain name

Well if you dont have a domain address you can use IP:Port in place of domain name. But we recommend using a domain name in Production Setup.

IP addresses can change and are not stable. For stable and long term access to your instance it is always a good idea to assign a domain name to your server. Based on the hosting provider you are using you have to follow their respective methods.

If you are completely new to clould hosting and dont know how to assign a domain name. Then follow these tutorials https://www.youtube.com/watch?v=7itQ-AXiM5o

https://www.digitalocean.com/community/tutorials/how-to-point-to-digitalocean-nameservers-from-common-domain-registrars

Step 4 : Enter container and update instance configuration

You need to change few api configuration settings like domain name & admin email to ensure that you are able to access your market Instance.

Enter your container and update api configuration.

                     Commands
                  

    docker-compose start
    (please ensure that you are inside the directory where docker-compose.yml resides)

    OR 

    docker start nbs_api_container 
    


    docker exec -it nbs_api_container bash

    cd ~/nearbyshops/data 
    
    sudo nano application.properties

    (Save and Exit using Ctrl + X)
    (Exit container using Ctrl + C or Ctrl + D)
                
                

Things to Update

  • Admin Email
  • Domain Name
  • Market ID for FCM
  • admin_email is the field name. Admin email is the email of the market admin. Without providing this you wont be able to access your market and change settings.

    domain_name is the field name and you need to set this equal to your domain name

    Setup Email and SMS (Can be skipped and Done later also) Email and SMS are required for sending live order status updates to the customers. They are also used for login purposes. The Email and SMS setup instructions are provided in our Integrations guide.

    You can skip Email and SMS setup and do this later also.

    Everytime you make a change in the configuration file you need to restart the server in order to ensure that changes are reflected.

                        Commands : Restart Container
                      
    
        docker-compose restart
        (please ensure that you are inside the directory where docker-compose.yml resides)
    
        OR
      
        docker stop nbs_api_container
    
        docker start nbs_api_container
    
                    
                    

    Step 5 : Generate Apps and Publish your app on Google Play

    You can customize our android app (White Label Solution) and connect the app to your Instance and publish to the Google Play. This is optional and isnt mandatory.

    More information about how to customize your app and publish on Google Play is given in the article Customize apps.

    Step 6 : Generate Admin app and Login as admin to Update Settings

    Case 1 : Free Version App

    In case you are using free and open source version. You need to generate a separate Admin app as given in the customize app tutorial.

    Remember the email that you assigned as admin email in the configuration file. You will use this email to login to your own Admin App that you have generated.

    After login go to the admin dashboard you will see Market Profile. Enter that screen. Set all the fields appropriately & save the settings.

    Case 2 : Full Version App

    In case you have a full version app you can login to the customer app and access the admin dashboard from customer app itself.

    Remember the email that you assigned as admin email in the configuration file. You will use this email to login to your own customer app that you have generated using App generation guide.

    In Case you have your custom App ready follow these instructions.

    Login to the customer app and go the profile screen, and you would see Admin Dashboard in Profile screen.

    Follow our tutorials to Learn more !

    To learn more about how to add vendors and use nearby shops. Please follow our tutorials given at this link https://blog.nearbyshops.org/tag/tutorials/

    Facing difficulty in understanding anything ? ... let us help you ! If you have any questions and queries do not hesitate to get in touch with us on our forum