0154.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Roll Your Own Google Docs with NextCloud and OnlyOffice in Docker</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Browser Based,Docker Made Easy,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Web Based,Web Based Tools,Cloud Solution,Container,Containerization,Docker,Docker Container,Docker Host,Docker How To,Docker Installation Tutorial,Docker Made Simple,OnlyOffice,Nextcloud,Ubuntu,Self-Hosted Google Docs Alternative,Linux,MariaDB,Free Software,Docker Simplified,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Roll Your Own Google Docs with NextCloud and OnlyOffice in Docker">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="08/29/2022 08:42:41 AM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Roll Your Own Google Docs with NextCloud and OnlyOffice in Docker</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is Nextcloud?</h2>
  26. <blockquote><em>Nextcloud is a suite of client-server software for creating and using file hosting services. It is enterprise-ready with comprehensive support options. Being free and open-source software, anyone is allowed to install and operate it on their own private server devices. -<a href="https://en.wikipedia.org/wiki/Nextcloud" target="_blank">https://en.wikipedia.org/wiki/Nextcloud</a></em></blockquote>
  27. <h2>What is ONLYOFFICE Document Server?</h2>
  28. <blockquote><em>ONLYOFFICE Document Server is an online office suite comprising viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time. -<a href="https://github.com/ONLYOFFICE/DocumentServer" target="_blank">https://github.com/ONLYOFFICE/DocumentServer</a></em></blockquote>
  29. <h2>Installing Docker</h2>
  30. <ol>
  31. <li>Log into the Linux based device</li>
  32. <li>Run the following commands in the terminal
  33. <div class="codeBlock"># install prerequisites<br />
  34. sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y<br />
  35. # add docker gpg key<br />
  36. curl -fsSL https://download.docker.com/linux/$(awk -F&#39;=&#39; &#39;/^ID=/{ print $NF }&#39; /etc/os-release)/gpg | sudo apt-key add -<br />
  37. # add docker software repository<br />
  38. sudo add-apt-repository &quot;deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F&#39;=&#39; &#39;/^ID=/{ print $NF }&#39; /etc/os-release) $(lsb_release -cs) stable&quot;<br />
  39. # install docker<br />
  40. sudo apt install docker-ce docker-compose containerd.io -y<br />
  41. # enable and start docker service<br />
  42. sudo systemctl enable docker &amp;&amp; sudo systemctl start docker<br />
  43. # add the current user to the docker group<br />
  44. sudo usermod -aG docker $USER<br />
  45. # reauthenticate for the new group membership to take effect<br />
  46. su - $USER</div>
  47. </li>
  48. </ol>
  49. <h2>Running Nextcloud and ONLYOFFICE</h2>
  50. <ol>
  51. <li>Now that Docker is installed, run the following commands to setup the Nextcloud Docker container and run it
  52. <div class="codeBlock"># create working directories<br />
  53. mkdir ~/docker/mariadb -p &amp;&amp; mkdir ~/docker/nextcloud -p &amp;&amp; mkdir ~/docker/onlyoffice/{logs,data,lib,db} -p<br />
  54. # set owner of working directories<br />
  55. sudo chown &quot;$USER&quot;:&quot;$USER&quot; /home/&quot;$USER&quot;/docker -R<br />
  56. # create nextcloud network<br />
  57. docker network create nextcloud<br />
  58. # run the mariadb docker container<br />
  59. docker run -d --name mariadb --network nextcloud --network-alias db -e MYSQL_ROOT_PASSWORD=r00tp@ss -e MYSQL_USER=nextcloud_rw -e MYSQL_PASSWORD=N3xtCl0ud! -e MYSQL_DATABASE=nextcloud -v /home/$USER/docker/mariadb:/var/lib/mysql --restart=unless-stopped mariadb:latest<br />
  60. # run the nextcloud docker container<br />
  61. docker run -d --name nextcloud --network nextcloud -p 8080:80 -e MYSQL_HOST=db -e MYSQL_USER=nextcloud_rw -e MYSQL_PASSWORD=N3xtCl0ud! -e MYSQL_DATABASE=nextcloud -v /home/$USER/docker/nextcloud:/var/www/html --restart=unless-stopped nextcloud:latest<br />
  62. # generate a 32 character random string<br />
  63. echo $(head /dev/urandom | LC_ALL=C tr -dc &#39;A-Za-z0-9&#39; | head -c 32)<br />
  64. # copy the output string to the clipboard<br />
  65. # run the onlyoffice document server container<br />
  66. docker run -d --name onlyoffice --network nextcloud -p 8081:80 -v ~/docker/onlyoffice/logs:/var/log/onlyoffice -v ~/docker/onlyoffice/data:/var/www/onlyoffice/Data -v ~/docker/onlyoffice/lib:/var/lib/onlyoffice -v ~/docker/onlyoffice/db:/var/lib/postgresql -e JWT_ENABLED=true -e JWT_SECRET=&#39;&lt;% random string from clipboard %&gt;&#39; --restart=unless-stopped onlyoffice/documentserver</div>
  67. </li>
  68. <li>Open a web browser and navigate to http://DNSorIP:8080</li>
  69. <li>The Nextcloud setup screen should be displayed</li>
  70. <li>Enter a username and password to create an admin account</li>
  71. <li>Click the Install button</li>
  72. <li>Choose to Install recommended apps or select Cancel to skip them</li>
  73. <li>Welcome to Nextcloud</li>
  74. </ol>
  75. <h2>Setting Up ONLYOFFICE</h2>
  76. <ol>
  77. <li>Click the user avatar &gt; Apps</li>
  78. <li>Select Office &amp; text from the left navigation</li>
  79. <li>Scroll down to find the OnlyOffice app &gt; Click Download and enable</li>
  80. <li>After the download completes, click the user avatar &gt; Settings</li>
  81. <li>Click ONLYOFFICE in the left navigation</li>
  82. <li>Enter the document server URL (http://DNSorIP:8081) in the Document Editing Service address field and paste the JWT_SECRET generated earlier into the Secret Key field &gt; Click Save</li>
  83. <li>Once Nextcloud has connected to the document server successfully, click on Files in the top navigation</li>
  84. <li>Click the + icon &gt; Select New Document</li>
  85. <li>Give the document a name and press Enter</li>
  86. <li>The new document should load in a word processor inside the web browser and be ready for editing</li>
  87. </ol>
  88. <p>Documentation: <a href="https://hub.docker.com/_/nextcloud" target="_blank">https://hub.docker.com/_/nextcloud</a>, <a href="https://hub.docker.com/r/onlyoffice/documentserver" target="_blank">https://hub.docker.com/r/onlyoffice/documentserver</a></p> </div>
  89. </div>
  90. </body>
  91. </html>