Cannot upload any themes, plugins or make persistent file changes

I’m on the latest version of EE. I have been running it for months now, with no changes made to my server I noticed over the last few days out of no where this issue has been happening. This is extremely inconvenient as it’s stopping me from being able to work on any of my sites.

I’ve created new sites on the server to duplicate the issue, same issue. I can’t upload any theme/plugin via dashboard, and any changes I make to custom CSS do not remain persistent.

When I try to upload a plugin or theme, upload status will just stay at 1% and after a few seconds my browser will just give me the “ERR_CONNECTION_RESET” error message.

What gives? Why has this happened on its own? Like I said I haven’t touched the back-end of things at all since setting up EE. I noticed that the directory of the websites (like example.com) belong to root, but everything in app/htdocs belongs to www-data which I’m pretty sure this is how it has always been, plus I’ve never played around with folder permissions anyway. It’s very strange because even a few days ago I was making a new site on my server and I did everything successfully, the site is up and running. But now I am having this issue across every single site that is on my EE server.

Ps. On each of my sites the max memory limit is 1GB, upload at 100M, execution time at a few minutes. So that’s not the issue here. Also cannot make any changes via plugin/theme editor. Any changes made will not save.

+-------------------+----------------------------------------------------------------------------+
| OS                | Linux 4.4.0-87-generic #110-Ubuntu SMP Tue Jul 18 12:55:35 UTC 2017 x86_64 |
| Shell             | /bin/bash                                                                  |
| PHP binary        | /usr/bin/php7.2                                                            |
| PHP version       | 7.2.13-1+ubuntu16.04.1+deb.sury.org+1                                      |
| php.ini used      | /etc/php/7.2/cli/php.ini                                                   |
| EE root dir       | phar://ee.phar                                                             |
| EE vendor dir     | phar://ee.phar/vendor                                                      |
| EE phar path      | /root                                                                      |
| EE packages dir   |                                                                            |
| EE global config  | /opt/easyengine/config/config.yml                                          |
| EE project config |                                                                            |
| EE version        | 4.0.9                                                                      |
+-------------------+----------------------------------------------------------------------------+
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:        16.04
Codename:       xenial
Client:
 Version:           18.09.0
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        4d60db4
 Built:             Wed Nov  7 00:48:57 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.0
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       4d60db4
  Built:            Wed Nov  7 00:16:44 2018
  OS/Arch:          linux/amd64
  Experimental:     false
docker-compose version 1.21.2, build a133471
docker-py version: 3.3.0
CPython version: 3.6.5
OpenSSL version: OpenSSL 1.0.1t  3 May 2016