로컬에서 Rocket.Chat 설치하고 실행하기

낡은피아노
Rocket.Chat 파헤치기
8 min readJan 6, 2019

일단 Rocket.Chat(이하 로켓챗)을 로컬에서 설치해보겠습니다.

공식 사이트에서는 Docker를 이용한 설치법을 안내하고 있습니다만, 실서비스를 위한 방법이므로 지금은 Vagrant를 이용해 Ubuntu 가상머신을 만들고 최신 배포판을 다운받아 실행해 보도록 하겠습니다.

Vagrant 설치

Vagrant는 바이너리로 배포를 하고 있으니 시스템에 맞는 배포판을 설치합니다.
Vagrant 다운로드 페이지로 이동

저는 macOS Mojave를 쓰고 있으므로 이하 설명은 macOS의 터미널로 하겠습니다.

Ubuntu 가상머신 설치

적당한 곳에 폴더를 하나 만들고 아래의 명령으로 vagrant 설정파일을 생성합니다.
Ubuntu 18.04 bionic 으로 설치해보겠습니다.

$ vagrant init ubuntu/bionic64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.

Vagrantfile이 생성되었습니다. 로켓챗 설치 후 가상머신(게스트)macOS(호스트)에서 브라우저로 접속해야하니 접속 포트를 열어주도록 설정을 변경해야합니다.

Vagrantfile,26

config.vm.network "forwarded_port", guest: 3000, host: 3000

26 라인의 주석처리를 제거하고 guesthost의 포트번호를 3000으로 변경합니다. 그리고 가상머신에 할당된 메모리를 조금 늘려주도록 합시다.

Vagrantfile,52c58

config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end

이제 가상머신을 기동해봅니다.

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/bionic64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/bionic64' is up to date...
==> default: A newer version of the box 'ubuntu/bionic64' for provider 'virtualbox' is
==> default: available! You currently have version '20181219.0.0'. The latest is version
==> default: '20190101.0.0'. Run `vagrant box update` to update.
==> default: Setting the name of the VM: vagrant_default_1546787792260_90691
==> default: Vagrant has detected a configuration issue which exposes a
==> default: vulnerability with the installed version of VirtualBox. The
==> default: current guest is configured to use an E1000 NIC type for a
==> default: network adapter which is vulnerable in this version of VirtualBox.
==> default: Ensure the guest is trusted to use this configuration or update
==> default: the NIC type using one of the methods below:
==> default:
==> default: https://www.vagrantup.com/docs/virtualbox/configuration.html#default-nic-type
==> default: https://www.vagrantup.com/docs/virtualbox/networking.html#virtualbox-nic-type
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 3000 (guest) => 3000 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection reset. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
default: /vagrant => ~/vagrant

가상머신이 실행되었으니 접속을 합니다.

$ vagrant ssh
Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-42-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Sun Jan 6 15:24:33 UTC 2019 System load: 0.0 Processes: 93
Usage of /: 9.8% of 9.63GB Users logged in: 0
Memory usage: 7% IP address for enp0s3: 10.0.2.15
Swap usage: 0%
Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud
0 packages can be updated.
0 updates are security updates.
vagrant@ubuntu-bionic:~$

이제 ubuntu 가상머신이 실행되었습니다. 로켓챗 최신버전을 snap으로 설치해보겠습니다.
보다 자세한 내용은 공식문서를 보시면 잘 나와있습니다.

$ sudo snap install rocketchat-server
rocketchat-server 0.72.3 from 'rocketchat' installed

snap은 설치와 동시에 실행까지 다 알아서 해주므로 브라우저에서 곧바로 http://localhost:3000으로 접속합니다.

로켓챗 첫 실행화면

설치마법사가 바로 나오는군요. 사실상 별로 한게 없이 간단히 실행됩니다.
실서버를 위해서는 SSL이나 도메인 설정, MongoDB 분리 등 해야할 것이 많습니다만, 다음에 알아보기로 합시다.

--

--