{"id":120242,"date":"2024-12-17T15:18:54","date_gmt":"2024-12-17T15:18:54","guid":{"rendered":"\/tutorials\/?p=120242"},"modified":"2025-03-27T06:34:17","modified_gmt":"2025-03-27T06:34:17","slug":"how-to-install-django","status":"publish","type":"post","link":"\/in\/tutorials\/how-to-install-django\/","title":{"rendered":"How to install Django on a VPS: Using Hostinger VPS template and manually\u00a0"},"content":{"rendered":"<p>Django is a high-level Python web framework that promotes rapid development and clean, pragmatic design. It simplifies many web development tasks, so you can focus on building your application without reinventing the wheel.<\/p><p>In this tutorial, we&rsquo;ll guide you through two methods to install Django on your virtual private server (VPS): using the Hostinger template for a quick setup and manually for more control over your environment.<\/p><p>By the end, you&rsquo;ll have Django running in a virtual environment, ready for development.<\/p><p>\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-prerequisites\">Prerequisites<\/h2><p>Before installing Django, it&rsquo;s important to be familiar with a few key concepts:<\/p><ul class=\"wp-block-list\">\n<li><strong>Basic Python knowledge<\/strong> &ndash; Django is a Python-based web framework, so you should understand Python fundamentals like data types, control flow (if\/else, loops), functions, classes, and modules. Familiarity with Python libraries and tools will also be beneficial.<\/li>\n\n\n\n<li><strong>HTML, CSS, and JavaScript basics<\/strong> &ndash; while Django focuses on back-end development, basic knowledge of front-end technologies such as HTML, CSS, and JavaScript is essential for <a href=\"\/in\/tutorials\/working-with-django-templates\/\">creating templates<\/a> and managing static files.<\/li>\n\n\n\n<li><strong>Understanding of databases<\/strong> &ndash; Django interacts closely with databases to store and manage data. Basic database concepts (tables, records, primary and foreign keys) are important. Knowledge of SQL is helpful, though Django&rsquo;s object-relational mapping (ORM) abstracts many database operations.<\/li>\n\n\n\n<li><strong>Command-line interface (CLI) familiarity<\/strong> &ndash; many Django tasks are performed through the command line. Basic knowledge of <a href=\"\/in\/tutorials\/linux-commands\/\">Linux commands<\/a> is necessary for managing your project.<\/li>\n<\/ul><p>\n\n\n        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Suggested Reading                <\/p>\n            <\/div>\n            <p class=\"protip__content\">Check out <a href=\"\/in\/tutorials\/what-can-you-do-with-python\/\">Python real-life use cases<\/a> and learning tips in our article.<\/p>\n                    <\/div>\n        \n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-installing-django-using-hostinger-s-vps-template\">Installing Django using Hostinger&rsquo;s VPS template<\/h2><p>Hostinger makes it easy to set up Django on your VPS using a dedicated template. This method simplifies the installation process, letting you avoid command-line setup while providing a stable and optimized environment for your Django application.<\/p><p>To start, consider your project&rsquo;s needs:<\/p><ul class=\"wp-block-list\">\n<li><strong>CPU and RAM<\/strong> &ndash; a faster CPU and more RAM improve performance, particularly for complex applications or high traffic.<\/li>\n\n\n\n<li><strong>Storage<\/strong> &ndash; Django applications handle databases and static files. Ensure your VPS has sufficient SSD storage for these requirements.<\/li>\n\n\n\n<li><strong>Bandwidth<\/strong> &ndash; choose a plan with enough bandwidth to handle expected traffic without slowdowns.<\/li>\n<\/ul><p>For a basic Django project, our <a href=\"\/in\/vps\/django-hosting\">Django VPS lower-tier plans<\/a>, like <strong>KVM 1<\/strong> or <strong>KVM 2<\/strong>, will suffice. As your project grows, you can easily scale up to a higher-tier plan.<\/p><p>After selecting your desired plan, set up the framework by choosing the <strong>OpenLiteSpeed and Django (built on Ubuntu 24.04)<\/strong> template during the onboarding process.<\/p><p>If you use our regular VPS plan or have previously installed a different template, follow these steps instead:<\/p><p>\n\n\n    <div class=\"announcement-block announcement-block--warning\">\n        <span class=\"announcement-block__heading\">\n            <svg width=\"24\" height=\"26\" viewBox=\"0 0 24 26\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n                d=\"M12 23.5C17.799 23.5 22.5 18.799 22.5 13C22.5 7.20101 17.799 2.5 12 2.5C6.20101 2.5 1.5 7.20101 1.5 13C1.5 18.799 6.20101 23.5 12 23.5ZM13.637 8.65198C13.637 7.74791 12.9041 7.01501 12 7.01501C11.0959 7.01501 10.363 7.74791 10.363 8.65198C10.5335 10.5375 10.875 14.383 10.875 14.383C10.875 15.0043 11.3787 15.508 12 15.508C12.6213 15.508 13.125 15.0043 13.125 14.383V14.38L13.637 8.65198ZM11.9927 16.714C11.3714 16.714 10.8677 17.2177 10.8677 17.839C10.8677 18.4603 11.3714 18.964 11.9927 18.964H12.0073C12.6286 18.964 13.1323 18.4603 13.1323 17.839C13.1323 17.2177 12.6286 16.714 12.0073 16.714H11.9927Z\"\n                fill=\"#BE1025\"\/>\n            <\/svg>\n            Warning        <\/span>\n        <p class=\"announcement-block__content\">\n                    <\/p>\n    <\/div>\n\n    \n\n\n\n<\/p><ol class=\"wp-block-list\">\n<li>Log in to hPanel and navigate to <strong>VPS &rarr; Manage<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"6a58b5c85d8b2\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a58b5c85d8b2\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"2846\" height=\"776\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-manage-highlighted.png\/w=1024,h=1024,fit=scale-down\" alt=\"The Manage button in hPanel\" class=\"wp-image-120243\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-manage-highlighted.png\/w=2846,fit=scale-down 2846w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-manage-highlighted.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-manage-highlighted.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-manage-highlighted.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-manage-highlighted.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-manage-highlighted.png\/w=1536,fit=scale-down 1536w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-manage-highlighted.png\/w=2048,fit=scale-down 2048w\" sizes=\"(max-width: 2846px) 100vw, 2846px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div><ol start=\"2\" class=\"wp-block-list\">\n<li>On your VPS dashboard&rsquo;s left sidebar, select <strong>OS &amp; Panel &rarr; Operating System<\/strong>.<\/li>\n\n\n\n<li>In the <strong>Change OS<\/strong> section, go to the <strong>Application<\/strong> tab.<\/li>\n\n\n\n<li>Select <strong>OpenLiteSpeed with Django<\/strong>. You can also find it easily using the search menu.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"6a58b5c85e89e\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a58b5c85e89e\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"2244\" height=\"608\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-operating-system-openlitespeed-with-django-highlighted.png\/w=1024,h=1024,fit=scale-down\" alt=\"The OpenLiteSpeed with Django template in hPanel's VPS\" class=\"wp-image-120244\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-operating-system-openlitespeed-with-django-highlighted.png\/w=2244,fit=scale-down 2244w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-operating-system-openlitespeed-with-django-highlighted.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-operating-system-openlitespeed-with-django-highlighted.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-operating-system-openlitespeed-with-django-highlighted.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-operating-system-openlitespeed-with-django-highlighted.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-operating-system-openlitespeed-with-django-highlighted.png\/w=1536,fit=scale-down 1536w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-operating-system-openlitespeed-with-django-highlighted.png\/w=2048,fit=scale-down 2048w\" sizes=\"(max-width: 2244px) 100vw, 2244px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div><ol start=\"5\" class=\"wp-block-list\">\n<li>When the popup appears, click <strong>Change OS<\/strong>, acknowledge the data deletion warning, and enter a new password for your server.<\/li>\n\n\n\n<li>Hit <strong>Confirm<\/strong> and wait for the process to complete within <strong>10<\/strong> minutes.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"6a58b5c85f737\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a58b5c85f737\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1272\" height=\"908\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-change-operating-system-confirm-highlighted.png\/w=1024,h=1024,fit=scale-down\" alt=\"The Confirm button in the Change operating system popup of hPanel's VPS\" class=\"wp-image-120245\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-change-operating-system-confirm-highlighted.png\/w=1272,fit=scale-down 1272w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-change-operating-system-confirm-highlighted.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-change-operating-system-confirm-highlighted.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-change-operating-system-confirm-highlighted.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/hpanel-vps-change-operating-system-confirm-highlighted.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1272px) 100vw, 1272px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div><p>Once done, you&rsquo;ll have a fully-configured server running Ubuntu <strong>24.04<\/strong> with Django and the OpenLiteSpeed web server.<\/p><figure class=\"wp-block-image size-large\"><a href=\"\/in\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-installing-django-manually\">Installing Django manually<\/h2><p>If you prefer using a different operating system, web server, or need more flexibility in setting up Django, you can manually install it using commands. Follow these steps:<\/p><h3 class=\"wp-block-heading\" id=\"h-1-access-your-vps\">1. Access your VPS<\/h3><p>To manually install Django, you first need to connect to your VPS using a terminal or an <a href=\"\/in\/tutorials\/how-to-use-putty-ssh\/\">SSH client like PuTTY<\/a>. Here are the instructions:<\/p><ol class=\"wp-block-list\">\n<li>Open your terminal and run the following command, replacing <strong>your_vps_ip<\/strong> with your VPS&rsquo; actual IP address:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ssh root@your_vps_ip<\/pre><ol start=\"2\" class=\"wp-block-list\">\n<li>When prompted, enter your root password to gain server access.<\/li>\n<\/ol><p>For <a href=\"\/in\/vps-hosting\">Hostinger VPS<\/a> customers, you can find your server&rsquo;s IP and root login credentials by navigating to the <strong>VPS details<\/strong> section in your VPS dashboard.<\/p><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"6a58b5c863642\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a58b5c863642\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2025\/02\/hpanel-vps-overview-ssh-username-ipv4-highlighted.png\/w=1024,h=1024,fit=scale-down\" alt=\"The SSH username and IPv4 information in the VPS Overview page of hPanel\"><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div><p>If you don&rsquo;t want to use external software, Hostinger users can also access their server via the <strong>Browser terminal<\/strong> feature. Simply hit the button in the top right corner of your VPS dashboard to log in automatically.<\/p><ol start=\"3\" class=\"wp-block-list\">\n<li>Once logged in, it&rsquo;s a good practice to update and upgrade your server with:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apt update &amp;&amp; apt upgrade -y<\/pre><p>After updating, your VPS will be ready to install Python and other required dependencies for Django development.<\/p><h3 class=\"wp-block-heading\" id=\"h-2-install-python\">2. Install Python<\/h3><p>To run Django, you&rsquo;ll need to <a href=\"\/in\/tutorials\/install-pip-in-ubuntu\/\">install Python and pip on your VPS<\/a>. Most modern Linux distributions, like Ubuntu, come with Python pre-installed.<\/p><p>Here&rsquo;s how to verify if Python is installed and to install or update it if necessary:<\/p><ol class=\"wp-block-list\">\n<li>Run the following command to check the current version of Python:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">python3 --version<\/pre><ul class=\"wp-block-list\">\n<li>If the command returns the Python version number, Python is already installed, and you just need to install <strong>pip<\/strong>, the package installer for Python.<\/li>\n<\/ul><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"6a58b5c864773\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a58b5c864773\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1806\" height=\"220\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/terminal-python3-version-output.png\/w=1024,h=1024,fit=scale-down\" alt=\"The python3 --version command's output in the terminal\" class=\"wp-image-120247\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/terminal-python3-version-output.png\/w=1806,fit=scale-down 1806w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/terminal-python3-version-output.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/terminal-python3-version-output.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/terminal-python3-version-output.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/terminal-python3-version-output.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/terminal-python3-version-output.png\/w=1536,fit=scale-down 1536w\" sizes=\"(max-width: 1806px) 100vw, 1806px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div><ul class=\"wp-block-list\">\n<li>If it returns an error, you&rsquo;ll need to install Python.<\/li>\n<\/ul><ol start=\"2\" class=\"wp-block-list\">\n<li>Here are the commands to install Python <strong>3<\/strong> and <strong>pip<\/strong>:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt update\nsudo apt install python3 python3-pip -y<\/pre><p>After that, you&rsquo;re ready to set up a virtual environment for your Django project.<\/p><h3 class=\"wp-block-heading\" id=\"h-3-set-up-a-virtual-environment\">3. Set up a virtual environment<\/h3><p>A virtual environment is an isolated space where you can install Python packages and dependencies for a specific project. This method doesn&rsquo;t affect the system-wide Python environment or other projects.<\/p><p>Using a virtual environment is especially important when working with Django, as different projects may require different versions of packages. It ensures that each project&rsquo;s dependencies are neatly contained and don&rsquo;t conflict with others.<\/p><p>Follow these steps to <a href=\"\/in\/tutorials\/how-to-create-a-python-virtual-environment\/\">set up a virtual environment on your VPS<\/a>:<\/p><ol class=\"wp-block-list\">\n<li>Install the <strong>venv<\/strong> package, if it&rsquo;s not already installed:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt install python3-venv -y<\/pre><ol start=\"2\" class=\"wp-block-list\">\n<li>Create and navigate to your project directory. Here, we name it <strong>myproject<\/strong>:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mkdir myproject\ncd myproject<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Create a virtual environment, replacing <strong>env_name<\/strong> with your preferred name:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">python3 -m venv env_name<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Activate the virtual environment:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">source env_name\/bin\/activate<\/pre><p>Once activated, your shell prompt will change to reflect the virtual environment name, indicating you&rsquo;re working within it.<\/p><h3 class=\"wp-block-heading\" id=\"h-4-install-django\">4. Install Django<\/h3><p>The last step is to install Django itself. You can do it by following these steps:<\/p><ol class=\"wp-block-list\">\n<li>Use <strong>pip<\/strong> to install the latest Django version:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip install django<\/pre><p>This will download and install Django and all its dependencies within the virtual environment.<\/p><ol start=\"2\" class=\"wp-block-list\">\n<li>Execute this command to check if Django is installed and to see the version:<\/li>\n<\/ol><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">django-admin --version<\/pre><p>You should see an output showing the current Django version, indicating that installation was successful.<\/p><div class=\"wp-block-image\">\n<figure data-wp-context='{\"imageId\":\"6a58b5c865f73\"}' data-wp-interactive=\"core\/image\" data-wp-key=\"6a58b5c865f73\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"2674\" height=\"184\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/terminal-environment-django-admin-version-output.png\/w=1024,h=1024,fit=scale-down\" alt=\"The django-admin --version command's output in the virtual environment shell of terminal\" class=\"wp-image-120248\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/terminal-environment-django-admin-version-output.png\/w=2674,fit=scale-down 2674w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/terminal-environment-django-admin-version-output.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/terminal-environment-django-admin-version-output.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/terminal-environment-django-admin-version-output.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/terminal-environment-django-admin-version-output.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/terminal-environment-django-admin-version-output.png\/w=1536,fit=scale-down 1536w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/52\/2024\/12\/terminal-environment-django-admin-version-output.png\/w=2048,fit=scale-down 2048w\" sizes=\"(max-width: 2674px) 100vw, 2674px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div><p>That&rsquo;s it! Now you can start <a href=\"\/in\/tutorials\/how-to-create-a-django-project\/\">building your Django application<\/a>.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>In this guide, we&rsquo;ve covered installing Django on your VPS using Hostinger&rsquo;s pre-configured template and through manual installation.<\/p><p>The former simplifies the process with just a few clicks, perfect for users who prefer easy setup. In contrast, the latter offers greater flexibility, especially if you use a different OS or need more control over your configuration.<\/p><p>With either approach, you now have a clean, isolated environment to efficiently build your Django application.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-install-django-faq\">How to install Django FAQ<\/h2><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1734447730686\"><h3 class=\"schema-faq-question\">Is Python required to install Django?<\/h3> <p class=\"schema-faq-answer\">Yes, Python is required to install Django. To install the latest version of Python and <strong>pip<\/strong>, run the following command: <strong>sudo apt install python3 python3-pip -y<\/strong><\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1734447775251\"><h3 class=\"schema-faq-question\">What version of Python do I need to install Django?<\/h3> <p class=\"schema-faq-answer\">Django supports older Python versions, but we suggest installing a newer version for better features, support, and performance. Python <strong>3.8<\/strong> or higher is ideal for compatibility with the latest Django features.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1734447793647\"><h3 class=\"schema-faq-question\">How do I verify my Django installation?<\/h3> <p class=\"schema-faq-answer\">Run the <strong>django-admin &ndash;version<\/strong> command in your terminal. If Django is successfully installed, you will see the version number. If you see an error message, Django is not installed.<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Django is a high-level Python web framework that promotes rapid development and clean, pragmatic design. It simplifies many web development tasks, so you can focus on building your application without reinventing the wheel. In this tutorial, we&rsquo;ll guide you through two methods to install Django on your virtual private server (VPS): using the Hostinger template [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/in\/tutorials\/how-to-install-django\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":185,"featured_media":120144,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"","rank_math_description":"","rank_math_focus_keyword":"","footnotes":""},"categories":[22642,22640],"tags":[],"class_list":["post-120242","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-pre-installed-applications","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-install-django","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-install-django","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-install-django","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-install-django","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-install-django","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-install-django","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-install-django","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-install-django","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/120242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/users\/185"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/comments?post=120242"}],"version-history":[{"count":7,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/120242\/revisions"}],"predecessor-version":[{"id":125964,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/120242\/revisions\/125964"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/media\/120144"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/media?parent=120242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/categories?post=120242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/tags?post=120242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}