{"id":426,"date":"2025-01-22T14:00:04","date_gmt":"2025-01-22T14:00:04","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2025\/01\/22\/10442498-how-to-use-the-anaconda-vps-template-at-hostinger\/"},"modified":"2025-01-22T14:00:04","modified_gmt":"2025-01-22T14:00:04","slug":"10442498-how-to-use-the-anaconda-vps-template-at-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/10442498-how-to-use-the-anaconda-vps-template-at-hostinger\/","title":{"rendered":"How to Use the Anaconda VPS Template at Hostinger"},"content":{"rendered":"<p class=\"no-margin\">Anaconda is a popular open-source distribution of Python and R, designed specifically for data science, machine learning, and AI development. It comes with a wide array of pre-installed libraries and tools such as Jupyter Notebook, Pandas, NumPy, and SciPy. Hostinger&rsquo;s &ldquo;Ubuntu 24.04 with Anaconda&rdquo; VPS template comes with Anaconda preinstalled, allowing you to start working on your projects right away. This guide will walk you through accessing and using Anaconda on your VPS.<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_44e5f9e516\">Accessing Your VPS<\/h2><p class=\"no-margin\">Open <b>Terminal <\/b>(Linux\/macOS) or <b>Command Prompt\/PowerShell<\/b> (Windows) on your local computer and enter the following command:<\/p><p class=\"no-margin\">\n<\/p><pre><code>ssh root@[your-vps-ip]<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Replace <code>[your-vps-ip]<\/code> with your <b><a href=\"\/support\/5139756-how-to-find-your-vps-ip-address\" target=\"_blank\" class=\"intercom-content-link\">VPS IP address<\/a><\/b>. You might be prompted to enter your VPS password.<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_956c03bb19\">Verifying Anaconda Installation<\/h2><p class=\"no-margin\"><b>Check Anaconda Version:<\/b><\/p><p class=\"no-margin\">After logging into your VPS, verify that Anaconda is installed by running:<\/p><pre><code>conda --version<\/code><\/pre><p class=\"no-margin\"><b>Update Anaconda Packages:<\/b><\/p><p class=\"no-margin\">Ensure your Anaconda installation is up to date:<\/p><pre><code>conda update --all<\/code><\/pre><p class=\"no-margin\">\n<\/p><h2 id=\"h_dad2621e91\">Creating and Managing Anaconda Environments<\/h2><p class=\"no-margin\"><b>Create a New Environment:<\/b><\/p><p class=\"no-margin\">To create a new Anaconda environment with a specific Python version:<\/p><pre><code>conda create -n myenv python=3.9<\/code><\/pre><p class=\"no-margin\">Replace <code>myenv<\/code> with your preferred environment name.<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\"><b>Activate the Environment:<\/b><\/p><p class=\"no-margin\">Switch to your newly created environment:<\/p><pre><code>conda activate myenv<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\"><b>Install Additional Packages:<\/b><\/p><p class=\"no-margin\">You can install packages using:<\/p><pre><code>conda install numpy pandas matplotlib<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\"><b>Deactivate the Environment:<\/b><\/p><p class=\"no-margin\">When done, deactivate the environment using:<\/p><pre><code>conda deactivate<\/code><\/pre><p class=\"no-margin\">\n<\/p><h2 id=\"h_b6351a32cd\">Using Jupyter Notebook<\/h2><p class=\"no-margin\"><b>Start Jupyter Notebook:<\/b><\/p><p class=\"no-margin\">Start Jupyter Notebook to work on data science projects:<\/p><pre><code>jupyter notebook --ip=0.0.0.0 --no-browser<\/code><\/pre><p class=\"no-margin\">The terminal will display a URL with an access token. Copy this URL.<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\"><b>Access Jupyter Notebook from Browser:<\/b><\/p><p class=\"no-margin\">On your local machine, open your browser and enter:<\/p><pre><code>http:\/\/[your-vps-ip]:8888<\/code><\/pre><p class=\"no-margin\">Replace <code>[your-vps-ip]<\/code> with your actual VPS IP address and use the token provided in the terminal.<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_393bef5eeb\">Securing Your Anaconda Environment<\/h2><p class=\"no-margin\"><b>Set Up Firewall Rules:<\/b><\/p><p class=\"no-margin\">Allow only necessary ports for Jupyter Notebook and SSH:<\/p><pre><code>sudo ufw allow 22\/tcp <br>sudo ufw allow 8888\/tcp <br>sudo ufw enable<\/code><\/pre><p class=\"no-margin\">\n<\/p><h2 id=\"h_4471381ba7\">Automating Anaconda Tasks<\/h2><p class=\"no-margin\"><b>Creating Scheduled Jobs:<\/b><\/p><p class=\"no-margin\">Automate tasks using <code>cron<\/code> jobs:<\/p><pre><code>crontab -e<\/code><\/pre><p class=\"no-margin\">Add an entry to run a Python script at regular intervals:<\/p><pre><code>0 * * * * \/root\/anaconda3\/bin\/python \/path\/to\/your_script.py<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">The &ldquo;Ubuntu 24.04 with Anaconda&rdquo; VPS template from Hostinger provides a powerful data science, machine learning, and AI development environment. Following this guide&rsquo;s steps, you can easily set up, manage, and secure your Anaconda environment. Whether you&rsquo;re working on Jupyter notebooks or deploying machine learning models, Anaconda simplifies package management and project organization.<\/p><p class=\"no-margin\">For more information, visit the official <a href=\"https:\/\/docs.anaconda.com\/\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">Anaconda documentation<\/a>.<\/p><p class=\"no-margin\">\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting started with the Anaconda VPS Template<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[206],"tags":[],"class_list":["post-426","post","type-post","status-publish","format-standard","hentry","category-vps-os-and-templates"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/10442498-how-to-use-the-anaconda-vps-template-at-hostinger\/","default":1}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/426","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=426"}],"version-history":[{"count":0,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/426\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}