Configure wiki.js(open source) on AWS EC2 instance

966 Views Asked by At

I've deployed wiki.js on AWS EC2 instance using docker. With installation Command as follows :

docker run -d -p 8080:3000 --name wiki --restart unless-stopped -e "DB_TYPE=mysql" -e "DB_HOST=172.0.0.1" -e "DB_PORT=3306" -e "DB_USER=wikijs" -e "DB_PASS=wikijsrocks" -e "DB_NAME=wiki" requarks/wiki:2

I've referred wiki.js installation . DB container and wiki containers are running in the same instance, When I check the above-created container logs, it shows the below output.

Loading configuration from /wiki/config.yml... OK
2021-07-21T16:13:45.924Z [MASTER] info: =======================================
2021-07-21T16:13:45.926Z [MASTER] info: = Wiki.js 2.5.201 =====================
2021-07-21T16:13:45.926Z [MASTER] info: =======================================
2021-07-21T16:13:45.927Z [MASTER] info: Initializing...
2021-07-21T16:13:47.149Z [MASTER] info: Using database driver mysql2 for mysql [ OK ]
2021-07-21T16:13:47.153Z [MASTER] info: Connecting to database...
2021-07-21T16:13:47.189Z [MASTER] info: Database Connection Successful [ OK ]
2021-07-21T16:13:47.237Z [MASTER] warn: DB Configuration is empty or incomplete. Switching to Setup mode...
2021-07-21T16:13:47.238Z [MASTER] info: Starting setup wizard...
2021-07-21T16:13:47.477Z [MASTER] info: Starting HTTP server on port 3000...
2021-07-21T16:13:47.478Z [MASTER] info: HTTP Server on port: [ 3000 ]
2021-07-21T16:13:47.482Z [MASTER] info: HTTP Server: [ RUNNING ]
2021-07-21T16:13:47.482Z [MASTER] info: 
2021-07-21T16:13:47.483Z [MASTER] info: 
2021-07-21T16:13:47.483Z [MASTER] info: Browse to http://YOUR-SERVER-IP:3000/ to complete setup!
2021-07-21T16:13:47.483Z [MASTER] info: 
2021-07-21T16:13:47.483Z [MASTER] info: 

But when I run container IP + port into the browser it shows This site can't be reached I've already opened ports 80, 443, and 3000 inside the security group attached with this instance. Unable to figure out the reason, why it's not loading wiki.js on the running URL.

It works deliberately in a local docker container, but not in a remote container. Can anyone please help me with this, any help would be appreciated.Thanks in advance.

1

There are 1 best solutions below

0
Victor Sandoval On

Same log output but with Postgre in the version I got. I managed to get it working by just running docker start wiki, following the installation process in Wiki.js website.

Have you set the inbound rules of the instance to allow you access over HTTP (not HTTPS)? If yes, you access the instance by just browsing its IP address (No port either as suggested). This is consistent with the local container I set up too.

Make sure the instance has an inbound rule/security group that supports HTTP requests (IPv4 version, TCP protocol, Port range of 80 and the appropriate Source depending on your case).