2

I purchased a VPS (ubuntu 20.04) to deploy my Laravel project .

After installing all dependencies :

  • PHP(7.4)
  • Mysql
  • Java 8
  • Composer
  • Npm
  • ElasticSearch
  • (...)

My question is : Is it possible to create something similar to an image with the previous installations in order to use it next time to install other VPS(s) without repeating the same work ?

1 Answer 1

0

If you are willing to read a little bit, ansible could be your friend here. You could build a simple playbook to deploy your packages automatically, distribute configuration files, and change system settings. Cloud-init could also be of use here, however I do not have experience with that tool. A simple ansible playbook that would just deploy your packages would look like(considering all are available in default repos):

- hosts: target_host
  become: true
  vars_files:
    - /path/to/vars/file/if/needed
  tasks:
    - name: Install Dependencies
      apt:
        pkg:
        - php=version
        - mysql
        - java-default
        - composer
        - npm
        - elasticsearch

You can also do a system backup with something like clonezilla or Veeam (the free veeam product for Linux does not require a reboot, and allows you to build bootable media for restores), though at that point you are going to have to worry about the underlying hardware matching that of your existing VM.

Basically, I do not believe there is a simple answer to throw at this. It may also be worth checking with your hosting provider to see if they have cloning functionality / image creating functionality (I know this is easy to accomplish in azure).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .