{"id":46655,"date":"2021-07-08T00:00:00","date_gmt":"2021-07-08T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/blog\/run-a-griddb-server-in-docker-desktop\/"},"modified":"2025-11-13T12:55:27","modified_gmt":"2025-11-13T20:55:27","slug":"run-a-griddb-server-in-docker-desktop","status":"publish","type":"post","link":"https:\/\/www.griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/","title":{"rendered":"Run a GridDB Server in Docker Desktop"},"content":{"rendered":"<p>In a previous blog on Docker, we ran the GridDB server in one container and the application in another. It worked well but there have been many requests to run GridDB in a container on Docker Desktop and the application on the host.<\/p>\n<p>It should be easy right? Wrong. On a Linux host, it just works but on Windows and MacOSX hosts, the different networking stacks don&#8217;t allow direct routing to the container which prevents the usual GridDB configuration from working.<\/p>\n<p>After spending time trying to make Windows or MacOSX Docker behave like Linux, a trick was discovered when configuring GridDB to allow it seamlessly work on Docker Desktop. That trick is setting the container hostname to localhost, so GridDB never sees the Docker bridge network that prevents it from communicating with the host.<\/p>\n<p>The following figure shows how when the GridDB server container doesn&#8217;t use localhost, it&#8217;s unable to communicate with the client across the 172.16.0.0 network but when the hostname is set to localhost, the connections are successful using the 127.0.0.1 address.<\/p>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/07\/docker_griddb.png\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/07\/docker_griddb.png\" alt=\"\" width=\"1562\" height=\"676\" class=\"aligncenter size-full wp-image-27632\" srcset=\"\/wp-content\/uploads\/2021\/07\/docker_griddb.png 1562w, \/wp-content\/uploads\/2021\/07\/docker_griddb-300x130.png 300w, \/wp-content\/uploads\/2021\/07\/docker_griddb-1024x443.png 1024w, \/wp-content\/uploads\/2021\/07\/docker_griddb-768x332.png 768w, \/wp-content\/uploads\/2021\/07\/docker_griddb-1536x665.png 1536w\" sizes=\"(max-width: 1562px) 100vw, 1562px\" \/><\/a><\/p>\n<h2>Start The Server<\/h2>\n<p>We&#8217;ll use the same server image as the previous blog which is hosted on <a href=\"https:\/\/hub.docker.com\/r\/griddbnet\/griddb\">DockerHub<\/a>.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">> docker pull griddbnet\/griddb<\/code><\/pre>\n<\/div>\n<p>Now we can start the server:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">> docker run --hostname=localhost -d -t  griddbnet\/griddb <\/code><\/pre>\n<\/div>\n<p>It can take a minute or so for the container to start, so watch the output of the docker log for that container until the cluster has been joined before trying to connect to it.<\/p>\n<h2>Run the Application<\/h2>\n<p>First fetch Sample1.java from GitHub <a href=\"https:\/\/github.com\/griddb\/griddb\/blob\/master\/docs\/sample\/program\/Sample1.java\">here<\/a>. I always remove the package line to not require a certain directory structure to make complilation easier. From there, I edit edit the GridStore Properties to look like the following:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">Properties props = new Properties();\nprops.setProperty(\"notificationMember\", \"127.0.0.1:10001\");\nprops.setProperty(\"clusterName\", \"defaultCluster\");\nprops.setProperty(\"user\", \"admin\"); \nprops.setProperty(\"password\", \"admin\");<\/code><\/pre>\n<\/div>\n<p>The above edits are required because GridDB in the Docker container is configured to use FIXED_LIST networking versus the default MULTICAST networking as described in this previous <a href=\"https:\/\/griddb.net\/en\/blog\/griddb-using-fixed-list-or-multicast-clustering\/\">blog post<\/a>.<\/p>\n<p>If you need to download the gridstore.jar file, it can be downloaded from <a href=\"https:\/\/repo1.maven.org\/maven2\/com\/github\/griddb\/gridstore\/4.6.0\/gridstore-4.6.0.jar\">MvnRepository<\/a>.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">> javac -cp \".:gridstore-4.6.0.jar\" Sample1.java\n> java -cp \".:gridstore-4.6.0.jar\" Sample1\nPerson:  name=name02 status=false count=2 lob=[65, 66, 67, 68, 69, 70, 71, 72, 73, 74]<\/code><\/pre>\n<\/div>\n<p>If you want to connect to GridDB using JDBC in SQLWorkBenchJ, you will need to set the driver to com.toshiba.mwcloud.gs.sql.Driver, the driver JAR path appropriately, and the URL to jdbc:gs:\/\/\/defaultCluster\/public?notificationMember=127.0.0.1:20001, and the username and password to their configured values (admin\/admin in the default GridDB container).<\/p>\n<p>In SqlWBConsole, the connect string would look like:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-bash\">SQL> WbConnect -driver=com.toshiba.mwcloud.gs.sql.Driver -driverJar=gridstore-jdbc-4.6.0.jar -url=jdbc:gs:\/\/\/defaultCluster\/public?notificationMember=127.0.0.1:20001 -username=admin -password=admin\n<\/code><\/pre>\n<\/div>\n<p>The gridstore-jdbc.jar can also be downloaded from <a href=\"https:\/\/repo1.maven.org\/maven2\/com\/github\/griddb\/gridstore-jdbc\/4.6.0\/gridstore-jdbc-4.6.0.jar\">MvnRepository<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a previous blog on Docker, we ran the GridDB server in one container and the application in another. It worked well but there have been many requests to run GridDB in a container on Docker Desktop and the application on the host. It should be easy right? Wrong. On a Linux host, it just [&hellip;]<\/p>\n","protected":false},"author":71,"featured_media":22024,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-46655","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Run a GridDB Server in Docker Desktop | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"In a previous blog on Docker, we ran the GridDB server in one container and the application in another. It worked well but there have been many requests\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Run a GridDB Server in Docker Desktop | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"In a previous blog on Docker, we ran the GridDB server in one container and the application in another. It worked well but there have been many requests\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/\" \/>\n<meta property=\"og:site_name\" content=\"GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/griddbcommunity\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-08T07:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-13T20:55:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.griddb.net\/wp-content\/uploads\/2017\/04\/blog_title_08.png\" \/>\n\t<meta property=\"og:image:width\" content=\"870\" \/>\n\t<meta property=\"og:image:height\" content=\"490\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Owen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:site\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Owen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/\"},\"author\":{\"name\":\"Owen\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66\"},\"headline\":\"Run a GridDB Server in Docker Desktop\",\"datePublished\":\"2021-07-08T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:55:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/\"},\"wordCount\":399,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2017\/04\/blog_title_08.png\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/\",\"url\":\"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/\",\"name\":\"Run a GridDB Server in Docker Desktop | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2017\/04\/blog_title_08.png\",\"datePublished\":\"2021-07-08T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:55:27+00:00\",\"description\":\"In a previous blog on Docker, we ran the GridDB server in one container and the application in another. It worked well but there have been many requests\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2017\/04\/blog_title_08.png\",\"contentUrl\":\"\/wp-content\/uploads\/2017\/04\/blog_title_08.png\",\"width\":870,\"height\":490},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb.net\/en\/#website\",\"url\":\"https:\/\/griddb.net\/en\/\",\"name\":\"GridDB: Open Source Time Series Database for IoT\",\"description\":\"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL\",\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"contentUrl\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"width\":200,\"height\":83,\"caption\":\"Fixstars\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/griddbcommunity\/\",\"https:\/\/x.com\/GridDBCommunity\",\"https:\/\/www.linkedin.com\/company\/griddb-by-toshiba\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66\",\"name\":\"Owen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/47438a5c81215c7a9043be1b427e0bbd8dc0f77bd536f147f8495575149e4325?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/47438a5c81215c7a9043be1b427e0bbd8dc0f77bd536f147f8495575149e4325?s=96&d=mm&r=g\",\"caption\":\"Owen\"},\"url\":\"https:\/\/www.griddb.net\/en\/author\/owen\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Run a GridDB Server in Docker Desktop | GridDB: Open Source Time Series Database for IoT","description":"In a previous blog on Docker, we ran the GridDB server in one container and the application in another. It worked well but there have been many requests","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/","og_locale":"en_US","og_type":"article","og_title":"Run a GridDB Server in Docker Desktop | GridDB: Open Source Time Series Database for IoT","og_description":"In a previous blog on Docker, we ran the GridDB server in one container and the application in another. It worked well but there have been many requests","og_url":"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2021-07-08T07:00:00+00:00","article_modified_time":"2025-11-13T20:55:27+00:00","og_image":[{"width":870,"height":490,"url":"https:\/\/www.griddb.net\/wp-content\/uploads\/2017\/04\/blog_title_08.png","type":"image\/png"}],"author":"Owen","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"Written by":"Owen","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/"},"author":{"name":"Owen","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66"},"headline":"Run a GridDB Server in Docker Desktop","datePublished":"2021-07-08T07:00:00+00:00","dateModified":"2025-11-13T20:55:27+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/"},"wordCount":399,"commentCount":0,"publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2017\/04\/blog_title_08.png","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/","url":"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/","name":"Run a GridDB Server in Docker Desktop | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2017\/04\/blog_title_08.png","datePublished":"2021-07-08T07:00:00+00:00","dateModified":"2025-11-13T20:55:27+00:00","description":"In a previous blog on Docker, we ran the GridDB server in one container and the application in another. It worked well but there have been many requests","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/blog\/run-a-griddb-server-in-docker-desktop\/#primaryimage","url":"\/wp-content\/uploads\/2017\/04\/blog_title_08.png","contentUrl":"\/wp-content\/uploads\/2017\/04\/blog_title_08.png","width":870,"height":490},{"@type":"WebSite","@id":"https:\/\/griddb.net\/en\/#website","url":"https:\/\/griddb.net\/en\/","name":"GridDB: Open Source Time Series Database for IoT","description":"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL","publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/","url":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","contentUrl":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","width":200,"height":83,"caption":"Fixstars"},"image":{"@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/griddbcommunity\/","https:\/\/x.com\/GridDBCommunity","https:\/\/www.linkedin.com\/company\/griddb-by-toshiba"]},{"@type":"Person","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66","name":"Owen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/47438a5c81215c7a9043be1b427e0bbd8dc0f77bd536f147f8495575149e4325?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/47438a5c81215c7a9043be1b427e0bbd8dc0f77bd536f147f8495575149e4325?s=96&d=mm&r=g","caption":"Owen"},"url":"https:\/\/www.griddb.net\/en\/author\/owen\/"}]}},"_links":{"self":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/users\/71"}],"replies":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/comments?post=46655"}],"version-history":[{"count":1,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46655\/revisions"}],"predecessor-version":[{"id":51330,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46655\/revisions\/51330"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/media\/22024"}],"wp:attachment":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/media?parent=46655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/categories?post=46655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/tags?post=46655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}