How to setup self hosted wiki for your startup
如何為您的新創公司建立自助式 wiki
When it comes to setting up a wiki for your startup, you’ve probably looked at popular options like Confluence and Notion. While these tools are feature-rich, there’s one major drawback: they can get expensive really fast.
說到為您的新創公司建立 wiki,您可能已經看過 Confluence 和 Notion 等熱門選項。雖然這些工具功能豐富,但有一個很大的缺點:它們的價格會變得非常昂貴。
Most of these services charge per user per month (typically around $5), and even with enterprise negotiations, the costs can add up quickly as your team grows. Sure, they offer advanced features and granular access controls, but let’s be honest - most startups don’t need all those fancy features.
大多數這類服務都是按使用者每月收費 (通常約為 5 美元),即使經過企業協商,成本也會隨著團隊的成長而快速增加。當然,這些服務提供進階功能和細膩的存取控製,但說實話,大部分的新創公司並不需要這些花俏的功能。
This is where self-hosted solutions shine. Your costs stay fixed regardless of how many employees join your company. After running a self-hosted wiki in production for over 3 years, I can confidently recommend Wiki.js as an excellent alternative to paid softwares.
這正是自助式解決方案的優勢所在。無論有多少員工加入您的公司,您的成本都是固定的。在自行託管的 wiki 運作超過 3 年之後,我可以自信地推薦 Wiki.js 作為付費軟體的絕佳替代方案。
Why Wiki.js? 為何選擇 Wiki.js?
Setting up Wiki.js is surprisingly simple - you can have it running in minutes using Docker Compose. The basic setup (Wiki.js + PostgreSQL) is quite lightweight and can run smoothly on a modest server with:
設定 Wiki.js 簡單得令人驚訝 - 您可以使用 Docker Compose 在幾分鐘內完成。基本設置(Wiki.js + PostgreSQL)相當輕量級,可以在不大的伺服器上順暢運行:
- 4GB RAM 4GB 記憶體
- 2 vCPU
If you want better search capabilities, you can add Elasticsearch as well, but you’ll need to increase the resources to atleast:
如果您想要更好的搜尋功能,您也可以新增 Elasticsearch,但至少需要增加資源:
- 8GB RAM 8GB 記憶體
- 2 vCPU
In our case, we’ve grown to over 1,000 pages and nearly 400 users, and our setup is still going strong. The only maintenance I’ve had to do was adding Elasticsearch for improved search functionality.
在我們的案例中,我們已經成長到超過 400 位使用者,而我們的設定仍然堅固耐用。我唯一需要做的維護是新增 Elasticsearch 以改善搜尋功能。
Cost Comparison 成本比較
Let’s talk numbers. Here’s what you might pay running this on AWS EC2:
讓我們來談談數字。以下是在 AWS EC2 上執行此功能可能需要支付的費用:
Instance Type 實例類型 | vCPU | RAM (GiB) | On-Demand ($/hr) 隨選 ($/hr) | Monthly On-Demand 每月隨選 | Reserved 1-year ($/hr) 保留 1 年 ($/hr) | Monthly Reserved 每月預留 |
---|---|---|---|---|---|---|
t4g.medium | 2 | 4 | $0.0224 | $16.35 | $0.0142 | $10.37 |
t4g.large | 2 | 8 | $0.0448 | $32.70 | $0.0283 | $20.66 |
To put this in perspective: if you had 400 users on a typical paid wiki platform charging $5 per user, you’d be looking at a $2,000+ monthly bill.
從這個角度來看:如果您有 $2,000 以上。
With a self-hosted solution, you will be paying less than $33/month even with the larger instance!
使用自行託管的解決方案,即使使用較大的實例,您每月支付的費用也會少於 $33 !
If you do need to scale up later, you can take small maintenance downtime to increase the instance size, or you can split the elasticsearch to a different instance.
如果以後真的需要擴充,您可以利用小量的維護停機時間來增加實體大小,或是將 elasticsearch 分割到不同的實體。
Making It Production-Ready
讓生產準備就緒
To transform this into a production-ready setup, I recommend implementing the following things:
若要將此轉換為生產就緒的設定,我建議執行下列事項:
- Set up a custom domain like
wiki.yourcompany.com
設定自訂網域,例如wiki.yourcompany.com
- Configure DNS and a Load Balancer to handle traffic
設定 DNS 和負載平衡器來處理流量 - Implement SSO with Google
與 Google 實施 SSO - Restrict self-registration to your company domain (e.g., yourcompany.com)
限製自行註冊為公司網域 (例如:yourcompany.com) - Set up hourly AMI backups of your EC2 instance
設定 EC2 實例的每小時 AMI 備份
The Setup 設定
Here’s the Docker Compose file you can use to do the complete setup:
以下是 Docker Compose 檔案,您可以用來進行完整的設定:
services:
db:
image: postgres:16.4
expose:
- 5432
ports:
- 5432:5432
restart: unless-stopped
volumes:
- db-data:/var/lib/postgresql/data
environment:
POSTGRES_DB: wiki
POSTGRES_PASSWORD: pass # Change this to a strong password
POSTGRES_USER: root
wiki:
image: requarks/wiki:2.5
depends_on:
- db
environment:
DB_TYPE: postgres
DB_HOST: db
DB_PORT: 5432
DB_USER: root
DB_PASS: pass # Change this to a strong password
DB_NAME: wiki
restart: unless-stopped
ports:
- "80:3000"
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.23
container_name: elasticsearch
restart: unless-stopped
ports:
- 127.0.0.1:9200:9200
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- xpack.security.http.ssl.enabled=false
- xpack.license.self_generated.type=basic
volumes:
db-data:
P.S. My friend is actively seeking opportunities in Product Management, Marketing Operations, or Data Analytics.
P.S. 我的朋友正在積極尋找產品管理、行銷營運或資料分析方面的機會。
He brings strong expertise in data analytics, mathematics, and finance. Currently based in Bangalore, India, he is open to both remote and in-office opportunities.
他在資料分析、數學和金融方面擁有豐富的專業知識。目前他在印度班加羅爾工作,同時歡迎遠距離及在辦公室工作的機會。
If you're looking for a driven professional with strong analytical skills and quick learning ability, please reach out to him directly:
如果您正在尋找一位有幹勁、分析能力強、學習能力快的專業人士,請直接與他聯繫:
- Email: sachin.23@dmsiitd.org
電子郵件:sachin.23@dmsiitd.org - LinkedIn: linkedin.com/in/sachiniit
LinkedIn:linkedin.com/in/sachiniit - Resume: View Resume
履歷: 檢視履歷
#wiki
#documentation
#postgres
#elasticsearch
#docker
#startup
#aws
#ec2
#wiki
#documentation
;#postgres
#elasticsearch
;#docker
#startup
;#aws
#ec2