{"id":3124,"date":"2025-04-27T23:31:10","date_gmt":"2025-02-28T03:40:47","guid":{"rendered":""},"modified":"2025-02-02T00:46:19","modified_gmt":"2025-02-01T23:46:19","slug":"how-to-install-bookstack-with-nginx-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-install-bookstack-with-nginx-on-ubuntu-20-04\/","title":{"rendered":"Linux VPS &#038; VPS Windows Setup Guide | NetCloud24 BookStack with Nginx on Ubuntu 20.04"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<article>\n<p>BookStack is an open-source platform designed to help you organize and manage documentation. It&#8217;s an easy-to-use tool that can be installed on an Ubuntu server and served with Nginx. In this guide, we\u2019ll show you how to install BookStack with Nginx on Ubuntu 20.04 and mirror your site using <strong>rsync<\/strong> to ensure redundancy. If you&#8217;re looking for hosting solutions, a <a href=\"https:\/\/ie.netcloud24.com\">Windows VPS <\/a> might be ideal for hosting your BookStack instance.<\/p>\n<section>\n<h2>Step 1: Update Your System<\/h2>\n<p>Before installing any software, it&#8217;s important to update your Ubuntu system. Run the following commands to ensure your server is up-to-date:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade<\/code><\/pre>\n<p>Keeping your system updated is critical whether you&#8217;re using a local server or a <a href=\"https:\/\/ie.netcloud24.com\">UK Windows VPS<\/a> to host your application.<\/p>\n<\/section>\n<section>\n<h2>Step 2: Install Required Dependencies<\/h2>\n<p>BookStack requires several dependencies such as PHP, MySQL, and Nginx. Install them by running the following command:<\/p>\n<pre><code>\r\nsudo apt install nginx mysql-server php php-fpm php-mysql git unzip\r\n            <\/code><\/pre>\n<p>Once installed, start and enable the services:<\/p>\n<pre><code>\r\nsudo systemctl start nginx\r\nsudo systemctl enable nginx\r\nsudo systemctl start mysql\r\nsudo systemctl enable mysql\r\n            <\/code><\/pre>\n<p>These dependencies are required to run BookStack, whether you&#8217;re deploying on an Ubuntu server or on a <a href=\"https:\/\/ie.netcloud24.com\">Windows VPSVirtual Private Server hosting<\/a> platform.<\/p>\n<\/section>\n<section>\n<h2>Step 3: Configure MySQL for BookStack<\/h2>\n<p>BookStack uses MySQL as its database, so you&#8217;ll need to create a database and user. First, secure your MySQL installation:<\/p>\n<pre><code>sudo mysql_secure_installation<\/code><\/pre>\n<p>Log into MySQL and create the BookStack database:<\/p>\n<pre><code>\r\nCREATE DATABASE bookstack;\r\nCREATE USER 'bookstackuser'@'localhost' IDENTIFIED BY 'your-password';\r\nGRANT ALL PRIVILEGES ON bookstack.* TO 'bookstackuser'@'localhost';\r\nFLUSH PRIVILEGES;\r\nEXIT;\r\n            <\/code><\/pre>\n<p>This setup ensures that BookStack has a dedicated user for database operations, which can be mirrored across multiple <a href=\"https:\/\/ie.netcloud24.com\">VPS Windows VPS Servers<\/a> or other environments using <strong>rsync<\/strong>.<\/p>\n<\/section>\n<section>\n<h2>Step 4: Download and Install BookStack<\/h2>\n<p>Now, clone the BookStack repository from GitHub and install it on your server:<\/p>\n<pre><code>\r\ncd \/var\/www\r\nsudo git clone https:\/\/github.com\/BookStackApp\/BookStack.git --branch release --single-branch bookstack\r\n            <\/code><\/pre>\n<p>Set the correct ownership and permissions for the BookStack directory:<\/p>\n<pre><code>sudo chown -R www-data:www-data \/var\/www\/bookstack<\/code><\/pre>\n<p>Now install Composer to handle PHP dependencies:<\/p>\n<pre><code>\r\ncd \/var\/www\/bookstack\r\nsudo apt install composer\r\ncomposer install\r\n            <\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 5: Configure BookStack<\/h2>\n<p>After the installation, copy the example environment configuration file:<\/p>\n<pre><code>cp .env.example .env<\/code><\/pre>\n<p>Open the <code>.env<\/code> file and update it with your MySQL database details:<\/p>\n<pre><code>\r\nDB_DATABASE=bookstack\r\nDB_USERNAME=bookstackuser\r\nDB_PASSWORD=your-password\r\n            <\/code><\/pre>\n<p>Once done, generate the application key:<\/p>\n<pre><code>php artisan key:generate<\/code><\/pre>\n<\/section>\n<section>\n<h2>Step 6: Configure Nginx<\/h2>\n<p>Create a new Nginx server block configuration file for BookStack:<\/p>\n<pre><code>sudo nano \/etc\/nginx\/sites-available\/bookstack<\/code><\/pre>\n<p>Add the following configuration:<\/p>\n<pre><code>\r\nserver {\r\n    listen 80;\r\n    server_name your-server-ip;\r\n    root \/var\/www\/bookstack\/public;\r\n\r\n    index index.php index.html;\r\n\r\n    location \/ {\r\n        try_files $uri $uri\/ \/index.php?$query_string;\r\n    }\r\n\r\n    location ~ \\.php$ {\r\n        include snippets\/fastcgi-php.conf;\r\n        fastcgi_pass unix:\/var\/run\/php\/php7.4-fpm.sock;\r\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n        include fastcgi_params;\r\n    }\r\n\r\n    location ~ \/\\.ht {\r\n        deny all;\r\n    }\r\n}\r\n            <\/code><\/pre>\n<p>Enable the site and restart Nginx:<\/p>\n<pre><code>\r\nsudo ln -s \/etc\/nginx\/sites-available\/bookstack \/etc\/nginx\/sites-enabled\/\r\nsudo systemctl restart nginx\r\n            <\/code><\/pre>\n<p>Your BookStack instance is now accessible via the server IP. This setup works well on <a href=\"https:\/\/ie.netcloud24.com\">Windows VPS hosting UK<\/a> and other similar environments.<\/p>\n<\/section>\n<section>\n<h2>Step 7: Mirror Your BookStack Installation with rsync<\/h2>\n<p>To ensure that your BookStack installation is mirrored across multiple servers, use <strong>rsync<\/strong>. This is especially useful when you\u2019re running multiple <a href=\"https:\/\/ie.netcloud24.com\">VPS Windows VPS Servers<\/a> or need redundancy for your data.<\/p>\n<p>Use the following command to sync your BookStack files to a remote server:<\/p>\n<pre><code>rsync -avz \/var\/www\/bookstack\/ user@remote-server:\/var\/www\/bookstack\/<\/code><\/pre>\n<p>This command mirrors your BookStack installation on a remote server. You can automate this process using cron jobs for regular backups.<\/p>\n<\/section>\n<section>\n<h2>Step 8: Finalize and Access BookStack<\/h2>\n<p>At this point, your BookStack instance should be fully installed and accessible. Navigate to <code>http:\/\/your-server-ip<\/code> in your browser to complete the initial setup.<\/p>\n<p>Whether you\u2019re hosting on a local server or a <a href=\"https:\/\/ie.netcloud24.com\">UK Windows VPS<\/a>, following these steps will give you a functional and well-configured BookStack platform.<\/p>\n<\/section>\n<\/article>\n<footer>\n<p>For reliable hosting options to run your BookStack instance, consider using <a href=\"https:\/\/ie.netcloud24.com\">Windows VPS <\/a>. They offer <strong>windows vps hosting<\/strong>, <strong>virtual private server hosting windows<\/strong>, and <strong>windows virtual dedicated server hosting<\/strong> to support your application with flexibility and performance. Whether you need <strong>windows vps italy<\/strong> or a <strong>uk vps windows<\/strong> solution, they have the services to meet your needs.<\/p>\n<\/footer>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 BookStack is an open-source platform designed to help you organize and manage documentation. It&#8217;s an easy-to-use tool that can be installed on an Ubuntu server and\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-3124","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/3124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=3124"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/3124\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=3124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=3124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=3124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}