# 【kong初探】安装konga

**URL:** <https://www.shiqidu.com/t/topic/718>\
**Category:** 资源分享\
**Tags:** 软件\
**Created:** [2020 年8 月 29 日 03:41 UTC](https://www.shiqidu.com/t/topic/718 "2020-08-29T03:41:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

作者： ![danton](https://www.shiqidu.com/user_avatar/www.shiqidu.com/danton/32/489_2.png) [@danton](https://www.shiqidu.com/u/danton)\
发布日期： [2020 年8 月 29 日 03:41 UTC](https://www.shiqidu.com/t/topic/718/1 "2020-08-29T03:41:39Z")

</div>

1. 首先补充一下上篇文章[【kong初探】在mac上安装和启动](https://www.shiqidu.com/d/930)中主角kong的概念和使用场景  
**kong 是在客户端和（微）服务间转发API通信的API网关** ，网关作为微服务必需的模块，主要使用场景包括鉴权、限流、路 由、负载均衡等等，网关除了kong还有Java生态中的zuul和spring cloud gateway等常见的。本文的konga是kong admin api（kong提供的restful api）的可视化管理后台。
2. 安装konga  
具体请查阅[GitHub konga](https://github.com/pantsel/konga)

```auto
# 下载代码安装依赖
git clone https://github.com/pantsel/konga.git
cd konga
npm i
~
# 不使用数据库就直接启动，否则跳过此步骤往下走
npm start
~
# 复制配置文件
cp .env_example .env
~
# 打开.env
PORT=1337
NODE_ENV=production
KONGA_HOOK_TIMEOUT=120000
DB_ADAPTER=postgres // 默认是postgres，其他可选项mysql，mongoDB
DB_URI=postgresql://localhost:5432/konga // 这里我们可以加上数据库账号密码，postgresql://username:password@localhost:5432/konga
KONGA_LOG_LEVEL=warn
TOKEN_SECRET=some_secret_token
~
# 启动
npm start

```

3. konga页面，如何操作有时间再补上  
 ![](https://discourse.shiqidu.com/uploads/default/original/1X/b18daa212dca390ca33b812502b49695a4f2a168.png)

---

<div class="post-metadata">

作者： ![Leon](https://www.shiqidu.com/user_avatar/www.shiqidu.com/leon/32/5_2.png) [@Leon](https://www.shiqidu.com/u/Leon)\
发布日期： [2020 年8 月 29 日 12:23 UTC](https://www.shiqidu.com/t/topic/718/2 "2020-08-29T12:23:57Z")

</div>

长见识了。
