In this tutorial I'll go over how to setup a VPS instance aka droplet on DigitalOcean, transfer your code to it using git and FileZilla, and have the code run either all the time, and link to resources that explain how to run it periodically using cron. This tutorial is aimed at total beginners and will go over every step of the process with all the necessary code and screenshots being included and will not focus on the more advanced stuff. Because of the target audience I will not focus on some of the things that you should do when setting up a server such as using an ssh key, creating a new non-root user, fail2ban etc. Every section will also have a short summary of the content - mostly so you can easily create notes or go over the steps again if necessary without reading the whole thing. Using screen to create additional shell windows and running your code in a new screen session. Note: Adding a valid payment method to your account is required to activate the bonus - you will not be charged anything if you add your CC. I'll use Linux for screenshots, terminal for ssh access and running the commands, OS X should have ssh support in its terminal too. DigitalOcean also offers web version of terminal which should work on all platforms, you can access it by clicking on your droplet name on homepage and then clicking "Access" tab and choosing "Console Access". For windows there's also PuTTY that you can install and use.
1. Creating a droplet
If you have a VPS or Dedicated server , you might be interested in finding the status of that server without having to wait at a terminal window. Instead, you can run a script that emails you this information about the status of your server. This only applies to your web server.
Join Stack Overflow to learn, share knowledge, and build your career. Connect and share knowledge within a single location that is structured and easy to search. What I do is I have a file called onboot. Contents of that file would be:. The L is optional. It will create a file called screenlog. For the script to be run on boot I use cron. In my case I use sudo crontab -e to edit the root user's crontab and append the following line:.
VPS benchmark script — based on the popular bench. Work fast with our official CLI. Learn more. If nothing happens, download GitHub Desktop and try again.