Skip to end of metadata
Go to start of metadata

Supported Distros

  • This instruction is only for Ubuntu 16.04. Docker container running on a Ubuntu 14.04 host is not supported.

 

  1. Install docker container from Linux repository packages.

    sudo apt update
    sudo apt install docker.io

     

  2. Install apache and necessary modules

    sudo apt install apache2
     
    sudo a2enmod proxy
    
    sudo a2enmod proxy_wstunnel
    
    sudo a2enmod proxy_http
    
    sudo a2enmod ssl
  3.  Create a file /etc/apache2/sites-available/codeserver.yourdomain.com.conf (use a name derived from your own URL here) with following lines:

      <VirtualHost *:80>
     ServerName codeserver.yourdomain.com
     </VirtualHost>
    


  4. Create a file /etc/apache2/sites-available/codeserver.yourdomain.com-ssl.conf with following lines:

    Note

    - You will need SSL certificate for the domain you will running CODE server on and the associated private key for this step.
    -  Place the certificate in the path /etc/apache2/ssl/server.crt
    -  Place the key in the path /etc/apache2/ssl/server.key

      <IfModule mod_ssl.c>
    <VirtualHost *:443>
      ServerName codeserver.yourdomain.com
    
    
      SSLEngine on
      # Intermediate configuration, tweak to your needs
      SSLProtocol             all -SSLv2 -SSLv3
      SSLCipherSuite          ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
     SSLHonorCipherOrder     on
     SSLCompression          off
    
      SSLCertificateFile /etc/apache2/ssl/server.crt
      SSLCertificateKeyFile /etc/apache2/ssl/server.key
    
      # Encoded slashes need to be allowed
      AllowEncodedSlashes NoDecode
    
      # Container uses a unique non-signed certificate
      SSLProxyEngine On
      SSLProxyVerify None
      SSLProxyCheckPeerCN Off
      SSLProxyCheckPeerName Off
    
      # keep the host
      ProxyPreserveHost On
    
      # static html, js, images, etc. served from loolwsd
      # loleaflet is the client part of LibreOffice Online
      ProxyPass /loleaflet https://127.0.0.1:9980/loleaflet retry=0
      ProxyPassReverse /loleaflet https://127.0.0.1:9980/loleaflet
    
      # WOPI discovery URL
      ProxyPass /hosting/discovery https://127.0.0.1:9980/hosting/discovery retry=0
      ProxyPassReverse /hosting/discovery https://127.0.0.1:9980/hosting/discovery
    
      # Main websocket
      ProxyPassMatch "/lool/(.*)/ws$" wss://127.0.0.1:9980/lool/$1/ws nocanon
    
      # Admin Console websocket
      ProxyPass /lool/adminws wss://127.0.0.1:9980/lool/adminws
    
      # Download as, Fullscreen presentation and Image upload operations
      ProxyPass /lool https://127.0.0.1:9980/lool
      ProxyPassReverse /lool https://127.0.0.1:9980/lool
    
    </VirtualHost>
    </IfModule>
    
    
  5. Enables sites configured from above steps

    sudo a2ensite codeserver.yourdomain.com.conf
    sudo a2ensite codeserver.yourdomain.com-ssl.conf
  6. For production mode, enable aufs storage driver for docker. First install necessary kernel modules for this

    sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual aufs-tools
  7. For production mode, enable aufs storage driver for docker. To enable aufs, edit file /etc/default/docker and add the following line and save the file.

     DOCKER_OPTS="--storage-driver=aufs"
  8. Reboot the host running the docker container.

  9. Download CODE docker container

    sudo docker pull collabora/code
  10. Start the CODE docker container

    sudo docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=filecloudserver\\.yourdomain\\.com' --restart always --cap-add MKNOD collabora/code
  • No labels