blob: 6f2eb9b54123c63ff68f733997f15011c4cca089 [file] [log] [blame]
{"version":3,"sources":["webpack:///./src/pages/docs/installation/index.mdx"],"names":["_frontmatter","layoutProps","MDXLayout","DefaultLayout","MDXContent","components","props","mdxType","parentName","isMDXComponent"],"mappings":"wPAQaA,G,UAAe,S,uNAC5B,IAAMC,EAAc,CAClBD,gBAEIE,EAAYC,IACH,SAASC,EAAT,GAGZ,IAFDC,EAEC,EAFDA,WACGC,EACF,8BACD,OAAO,YAACJ,EAAD,eAAeD,EAAiBK,EAAhC,CAAuCD,WAAYA,EAAYE,QAAQ,cAG5E,iBAAQ,CACN,GAAM,oDADR,oDAGA,qOAGA,iBAAQ,CACN,GAAM,gDADR,iDAGA,qBAAG,sBAAQC,WAAW,KAAnB,YACH,qBAAG,6BAAGA,WAAW,KAAQ,CACrB,KAAQ,oDADT,0BAAH,+DAG6B,0BAAYA,WAAW,KAAvB,kBAH7B,oBAIA,+PAGA,qBAAG,sBAAQA,WAAW,KAAnB,UACH,qBAAG,6BAAGA,WAAW,KAAQ,CACrB,KAAQ,4CADT,2BAAH,yFAG4D,0BAAYA,WAAW,KAAvB,kBAH5D,oHAKF,6BAAGA,WAAW,KAAQ,CAChB,KAAQ,6CADd,4CALE,eAQA,qBAAG,sBAAQA,WAAW,KAAnB,YACH,yLAEF,6BAAGA,WAAW,KAAQ,CAChB,KAAQ,gCADd,cAFE,6SAO+C,6BAAGA,WAAW,KAAQ,CACjE,KAAQ,oDADmC,kEAP/C,kCAUA,iBAAQ,CACN,GAAM,uCADR,yCAGA,qBAAG,6BAAGA,WAAW,KAAQ,CACrB,KAAQ,uCADT,yBAAH,kDAIA,uBAAK,gCAAMA,WAAW,OAAU,CAC5B,UAAa,kBADZ,yDAIL,uFAAsE,0BAAYA,WAAW,KAAvB,YAAtE,uCAEA,iBAAQ,CACN,GAAM,4CADR,6CAGA,sEACA,uBAAK,gCAAMA,WAAW,OAAU,CAC5B,UAAa,kBADZ,oBAIL,yDACA,uBAAK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B,eAA9wB,eAAs1B,0BAAYA,WAAW,MAAvB,KAAt1B,6BAAk6B,kBAAIA,WAAW,MAAf,UAAl6B,6CAAm/B,kBAAIA,WAAW,MAAf,OAAn/B,0FACA,kBAAIA,WAAW,MAAf,cAAmC,0BAAYA,WAAW,MAAvB,aAAnC,eAAyG,0BAAYA,WAAW,MAAvB,wBAAzG,mBAA8L,0BAAYA,WAAW,MAAvB,cAA9L,qMAA2b,0BAAYA,WAAW,MAAvB,wBAA3b,qPAAkvB,0BAAYA,WAAW,MAAvB,YAAlvB,OAA+yB,0BAAYA,WAAW,MAAvB,gBAA/yB,kCAA24B,0BAAYA,WAAW,MAAvB,WAA34B,mGAAmiC,0BAAYA,WAAW,MAAvB,WAAniC,wCAAgoC,0BAAYA,WAAW,MAAvB,iCAAhoC,qCAAgvC,0BAAYA,WAAW,MAAvB,aAAhvC,oC,qNAMNJ,EAAWK,gBAAiB","file":"component---src-pages-docs-installation-index-mdx-0d6e7d1a1e40e7afafbe.js","sourcesContent":["import * as React from 'react'\n /* @jsx mdx */\nimport { mdx } from '@mdx-js/react';\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\n\nimport DefaultLayout from \"/home/runner/work/superset/superset/docs/node_modules/gatsby-theme-docz/src/base/Layout.js\";\nexport const _frontmatter = {};\nconst layoutProps = {\n _frontmatter\n};\nconst MDXLayout = DefaultLayout;\nexport default function MDXContent({\n components,\n ...props\n}) {\n return <MDXLayout {...layoutProps} {...props} components={components} mdxType=\"MDXLayout\">\n\n\n <h2 {...{\n \"id\": \"installing-superset-locally-using-docker-compose\"\n }}>{`Installing Superset Locally Using Docker Compose`}</h2>\n <p>{`The fastest way to try Superset locally is using Docker and Docker Compose on a Linux or Mac OSX\ncomputer. Superset does not have official support for Windows, so we have provided a VM workaround\nbelow.`}</p>\n <h3 {...{\n \"id\": \"1-install-a-docker-engine-and-docker-compose\"\n }}>{`1. Install a Docker Engine and Docker Compose`}</h3>\n <p><strong parentName=\"p\">{`Mac OSX`}</strong></p>\n <p><a parentName=\"p\" {...{\n \"href\": \"https://docs.docker.com/docker-for-mac/install/\"\n }}>{`Install Docker for Mac`}</a>{`, which includes the Docker\nengine and a recent version of `}<inlineCode parentName=\"p\">{`docker-compose`}</inlineCode>{` out of the box.`}</p>\n <p>{`Once you have Docker for Mac installed, open up the preferences pane for Docker, go to the\n\"Resources\" section and increase the allocated memory to 6GB. With only the 2GB of RAM allocated by\ndefault, Superset will fail to start.`}</p>\n <p><strong parentName=\"p\">{`Linux`}</strong></p>\n <p><a parentName=\"p\" {...{\n \"href\": \"https://docs.docker.com/engine/install/\"\n }}>{`Install Docker on Linux`}</a>{` by following Docker’s\ninstructions for whichever flavor of Linux suits you. Because `}<inlineCode parentName=\"p\">{`docker-compose`}</inlineCode>{` is not installed as\npart of the base Docker installation on Linux, once you have a working engine, follow the\n`}<a parentName=\"p\" {...{\n \"href\": \"https://docs.docker.com/compose/install/\"\n }}>{`docker-compose installation instructions`}</a>{` for Linux.`}</p>\n <p><strong parentName=\"p\">{`Windows`}</strong></p>\n <p>{`Superset is not officially supported on Windows unfortunately. One option for Windows users to\ntry out Superset locally is to install an Ubuntu Desktop VM via\n`}<a parentName=\"p\" {...{\n \"href\": \"https://www.virtualbox.org/\"\n }}>{`VirtualBox`}</a>{` and proceed with the Docker on Linux instructions inside\nof that VM. We recommend assigning at least 8GB of RAM to the virtual machine as well as\nprovisioning a hard drive of at least 40GB, so that there will be enough space for both the OS and\nall of the required dependencies. Docker Desktop `}<a parentName=\"p\" {...{\n \"href\": \"https://docs.docker.com/docker-for-windows/wsl/\"\n }}>{`recently added support for Windows Subsystem for Linux (WSL) 2`}</a>{`, which may be another option.`}</p>\n <h3 {...{\n \"id\": \"2-clone-supersets-github-repository\"\n }}>{`2. Clone Superset's Github repository`}</h3>\n <p><a parentName=\"p\" {...{\n \"href\": \"https://github.com/apache/superset\"\n }}>{`Clone Superset's repo`}</a>{` in your terminal with the\nfollowing command:`}</p>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-bash\"\n }}>{`$ git clone https://github.com/apache/superset.git\n`}</code></pre>\n <p>{`Once that command completes successfully, you should see a new `}<inlineCode parentName=\"p\">{`superset`}</inlineCode>{` folder in your\ncurrent directory.`}</p>\n <h3 {...{\n \"id\": \"3-launch-superset-through-docker-compose\"\n }}>{`3. Launch Superset Through Docker Compose`}</h3>\n <p>{`Navigate to the folder you created in step 1:`}</p>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-bash\"\n }}>{`$ cd superset\n`}</code></pre>\n <p>{`Then, run the following command:`}</p>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-bash\"\n }}>{`$ docker-compose -f docker-compose-non-dev.yml up\n`}</code></pre>\n <p>{`You should see a wall of logging output from the containers being launched on your machine. Once\nthis output slows, you should have a running instance of Superset on your local machine!`}</p>\n <p><strong parentName=\"p\">{`Note:`}</strong>{` This will bring up superset in a non-dev mode, changes to the codebase will not be reflected.\nIf you would like to run superset in dev mode to test local changes, simply replace the previous command with: `}<inlineCode parentName=\"p\">{`docker-compose up`}</inlineCode>{`,\nand wait for the `}<inlineCode parentName=\"p\">{`superset_node`}</inlineCode>{` container to finish building the assets.`}</p>\n <h4 {...{\n \"id\": \"configuring-docker-compose\"\n }}>{`Configuring Docker Compose`}</h4>\n <p>{`The following is for users who want to configure how Superset starts up in Docker Compose; otherwise, you can skip to the next section.`}</p>\n <p>{`You can configure the Docker Compose settings for dev and non-dev mode with `}<inlineCode parentName=\"p\">{`docker/.env`}</inlineCode>{` and `}<inlineCode parentName=\"p\">{`docker/.env-non-dev`}</inlineCode>{` respectively. These environment files set the environment for most containers in the Docker Compose setup, and some variables affect multiple containers and others only single ones.`}</p>\n <p>{`One important variable is `}<inlineCode parentName=\"p\">{`SUPERSET_LOAD_EXAMPLES`}</inlineCode>{` which determines whether the `}<inlineCode parentName=\"p\">{`superset_init`}</inlineCode>{` container will load example data and visualizations into the database and Superset. These examples are quite helpful for most people, but probably unnecessary for experienced users. The loading process can sometimes take a few minutes and a good amount of CPU, so you may want to disable it on a resource-constrained device.`}</p>\n <p><strong parentName=\"p\">{`Note:`}</strong>{` Users often want to connect to other databases from Superset. Currently, the easiest way to do this is to modify the `}<inlineCode parentName=\"p\">{`docker-compose-non-dev.yml`}</inlineCode>{` file and add your database as a service that the other services depend on (via `}<inlineCode parentName=\"p\">{`x-superset-depends-on`}</inlineCode>{`). Others have attempted to set `}<inlineCode parentName=\"p\">{`network_mode: host`}</inlineCode>{` on the Superset services, but these generally break the installation, because the configuration requires use of the Docker Compose DNS resolver for the service names. If you have a good solution for this, let us know!`}</p>\n <h3 {...{\n \"id\": \"4-log-in-to-superset\"\n }}>{`4. Log in to Superset`}</h3>\n <p>{`Your local Superset instance also includes a Postgres server to store your data and is already\npre-loaded with some example datasets that ship with Superset. You can access Superset now via your\nweb browser by visiting `}<inlineCode parentName=\"p\">{`http://localhost:8088`}</inlineCode>{`. Note that many browsers now default to `}<inlineCode parentName=\"p\">{`https`}</inlineCode>{` - if\nyours is one of them, please make sure it uses `}<inlineCode parentName=\"p\">{`http`}</inlineCode>{`.`}</p>\n <p>{`Log in with the default username and password:`}</p>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-bash\"\n }}>{`username: admin\n`}</code></pre>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-bash\"\n }}>{`password: admin\n`}</code></pre>\n <h3 {...{\n \"id\": \"5-connecting-your-local-database-instance-to-superset\"\n }}>{`5. Connecting your local database instance to superset`}</h3>\n <p>{`When running Superset using `}<inlineCode parentName=\"p\">{`docker`}</inlineCode>{` or `}<inlineCode parentName=\"p\">{`docker-compose`}</inlineCode>{` it runs in its own docker container, as if the Superset was running in a separate machine entirely. Therefore attempts to connect to your local database with hostname `}<inlineCode parentName=\"p\">{`localhost`}</inlineCode>{` won't work as `}<inlineCode parentName=\"p\">{`localhost`}</inlineCode>{` refers to the docker container Superset is running in, and not your actual host machine. Fortunately, docker provides an easy way to access network resources in the host machine from inside a container, and we will leverage this capability to connect to our local database instance.`}</p>\n <p>{`Here the instructions are for connecting to postgresql (which is running on your host machine) from Superset (which is running in its docker container). Other databases may have slightly different configurations but gist would be same and boils down to 2 steps -`}</p>\n <ol>\n <li parentName=\"ol\"><strong parentName=\"li\">{`(Mac users may skip this step)`}</strong>{` Configuring the local postgresql/database instance to accept public incoming connections. By default postgresql only allows incoming connections from `}<inlineCode parentName=\"li\">{`localhost`}</inlineCode>{` only, but re-iterating once again, `}<inlineCode parentName=\"li\">{`localhosts`}</inlineCode>{` are different for host machine and docker container. For postgresql this involves make one-line changes to the files `}<inlineCode parentName=\"li\">{`postgresql.conf`}</inlineCode>{` and `}<inlineCode parentName=\"li\">{`pg_hba.conf`}</inlineCode>{`, you can find helpful links tailored to your OS / PG version on the web easily for this task. For docker it suffices to only whitelist IPs `}<inlineCode parentName=\"li\">{`172.0.0.0/8`}</inlineCode>{` instead of `}<inlineCode parentName=\"li\">{`*`}</inlineCode>{`, but in any case you are `}<em parentName=\"li\">{`warned`}</em>{` that doing this in a production database `}<em parentName=\"li\">{`may`}</em>{` have disastrous consequences as you are opening your database to the public internet.`}</li>\n <li parentName=\"ol\">{`Instead of `}<inlineCode parentName=\"li\">{`localhost`}</inlineCode>{`, try using `}<inlineCode parentName=\"li\">{`host.docker.internal`}</inlineCode>{` (Mac users) or `}<inlineCode parentName=\"li\">{`172.18.0.1`}</inlineCode>{` (Linux users) as the host name when attempting to connect to the database. This is docker internal detail, what is happening is that in Mac systems docker creates a dns entry for the host name `}<inlineCode parentName=\"li\">{`host.docker.internal`}</inlineCode>{` which resolves to the correct address for the host machine, whereas in linux this is not the case (at least by default). If neither of these 2 hostnames work then you may want to find the exact host name you want to use, for that you can do `}<inlineCode parentName=\"li\">{`ifconfig`}</inlineCode>{` or `}<inlineCode parentName=\"li\">{`ip addr show`}</inlineCode>{` and look at the IP address of `}<inlineCode parentName=\"li\">{`docker0`}</inlineCode>{` interface that must have been created by docker for you. Alternately if you don't even see the `}<inlineCode parentName=\"li\">{`docker0`}</inlineCode>{` interface try (if needed with sudo) `}<inlineCode parentName=\"li\">{`docker network inspect bridge`}</inlineCode>{` and see if there is an entry for `}<inlineCode parentName=\"li\">{`\"Gateway\"`}</inlineCode>{` and note the IP address.`}</li>\n </ol>\n\n </MDXLayout>;\n}\n;\nMDXContent.isMDXComponent = true;\n "],"sourceRoot":""}