Sponsor: Quick testing across devices with this browser built for web developers.
If you prefer VPS over shared hosting, you can enjoy greater control, scalability, and security for your WordPress website.
With a VPS, you have dedicated resources and the flexibility to customize your server environment to meet your specific needs.
It can be daunting to manage WordPress in a VPS environment, though.
I recently tried Coolify and liked it.
Coolify is PaaS for self-hosting your application. It is an alternative to Heroku or even Vercel and Netlify.
I tried to self-host a WordPress website.
There are a bunch of resources ready to install, including WordPress with MySQL as the database.
To me, phpMyAdmin and FTP are still necessary applications for this stack to operate properly.
Here is how I add FTP and phpMyadmin to the existing Coolify stack.
Adding phpMyAdmin to the default Coolify WordPress Stack
Following the successful installation of Coolify's WordPress and MySQL stack,
Open the Compose File. Take a look at the last service from this compose file.
services:
wordpress:
image: 'wordpress:latest'
volumes:
- 'wordpress-files:/var/www/html'
environment:
- SERVICE_FQDN_WORDPRESS
- WORDPRESS_DB_HOST=mysql
- WORDPRESS_DB_USER=$SERVICE_USER_WORDPRESS
- WORDPRESS_DB_PASSWORD=$SERVICE_PASSWORD_WORDPRESS
- WORDPRESS_DB_NAME=wordpress
depends_on:
- mysql
healthcheck:
test:
- CMD
- curl
- '-f'
- 'http://127.0.0.1'
interval: 2s
timeout: 10s
retries: 10
mysql:
image: 'mysql:5.7'
volumes:
- 'mysql-data:/var/lib/mysql'
environment:
- MYSQL_ROOT_PASSWORD=$SERVICE_PASSWORD_ROOT
- MYSQL_DATABASE=wordpress
- MYSQL_USER=$SERVICE_USER_WORDPRESS
- MYSQL_PASSWORD=$SERVICE_PASSWORD_WORDPRESS
healthcheck:
test:
- CMD
- mysqladmin
- ping
- '-h'
- 127.0.0.1
interval: 5s
timeout: 20s
retries: 10
pma:
depends_on:
- mysql
image: phpmyadmin/phpmyadmin
ports:
- '8070:80'
environment:
- PMA_HOST=mysql
- PMA_PASSWORD=$SERVICE_PASSWORD_ROOT
- From that code, you can see that we add
pma
container. - Make sure
depends_on
value has the same name of the database service name. In my casemysql
. - Make sure you also have the same service name for
PMA_HOST
with the database name, in my casemysql
. - Make sure the port does not conflict with the other port you currently have.
- Save and click "Pull Latest Images & Restart".
- Open the link that has the associated port, ex:
http://<vps IP>:<port number>
. - Fill in the username with
root
and copy theSERVICE_PASSWORD_ROOT
value as the password. - You should successfully log in to the phpMyAdmin panel.
Adding FTP to the default Coolify WordPress Stack
Now let's add the FTP to the service stack.
Take a look at the last service from this Docker compose file.
services:
wordpress:
image: 'wordpress:latest'
volumes:
- 'wordpress-files:/var/www/html'
environment:
- SERVICE_FQDN_WORDPRESS
- WORDPRESS_DB_HOST=mysql
- WORDPRESS_DB_USER=$SERVICE_USER_WORDPRESS
- WORDPRESS_DB_PASSWORD=$SERVICE_PASSWORD_WORDPRESS
- WORDPRESS_DB_NAME=wordpress
depends_on:
- mysql
healthcheck:
test:
- CMD
- curl
- '-f'
- 'http://127.0.0.1'
interval: 2s
timeout: 10s
retries: 10
mysql:
image: 'mysql:5.7'
volumes:
- 'mysql-data:/var/lib/mysql'
environment:
- MYSQL_ROOT_PASSWORD=$SERVICE_PASSWORD_ROOT
- MYSQL_DATABASE=wordpress
- MYSQL_USER=$SERVICE_USER_WORDPRESS
- MYSQL_PASSWORD=$SERVICE_PASSWORD_WORDPRESS
healthcheck:
test:
- CMD
- mysqladmin
- ping
- '-h'
- 127.0.0.1
interval: 5s
timeout: 20s
retries: 10
pma:
depends_on:
- mysql
image: phpmyadmin/phpmyadmin
ports:
- '8070:80'
environment:
- PMA_HOST=mysql
- PMA_PASSWORD=$SERVICE_PASSWORD_ROOT
ftp:
image: delfer/alpine-ftp-server
network_mode: host
ports:
- '21:21'
- '21000-21010:21000-21010'
environment:
- USERS=rootadmin|yourrootpass|/var/www/html|10002
volumes:
- 'wordpress-files:/var/www/html'
- Notice we add
ftp
service to the stack. - Make sure you have the
environment
that haveUSERS
with valueusername|password|folder|uid
. In my case,rootadmin
is my FTP username,yourrootpass
is my FTP password,/var/www/html
is my FTP folder, and1002
is my FTPuid
. - Save and click "Pull Latest Images & Restart"
- Now you can try using an FTP application like Filezilla to access the Wordpress file folder.
That's it, now you have phpMyAdmin and FTP on the default Coolify WordPress stack.
Start your VPS server and get free $200 credit for you DigitalOcean.