Symlinked plugin does not appear in Admin

Mac OSX 11
Created a symlink to a plugin, but it does not appear in Admin/Plugins
When I copied the files, to KinstaDev, it worked.

Hi @iianev . Welcome to DevKinsta forums. Thanks for trying out DevKinsta! I’m afraid at this time symlinked directories are not supported but we’ll look into this as a future feature.

Hi! Any updates on this?

Hi @oleg_petcu, thanks for reaching out! I’ll bring this up with our developers again. I do not see it being added to upcoming releases.

1 Like

@Kevin This is a must have for any plugin developer, could you make a force on this? I can’t use your software without this.

Hi @alexmigf we’re nearing the end of the 2.x.x updates. Symlink support is definitely on the list for the next set of updates.

Can you please provide an example of a use case here? Are you just creating a symlink within your filesystem/WP files to a local directory and wanting it to work with Docker/WordPress? If that’s all this request is, I can research to see if there’s a way to do it with Docker commands.

Hi @Kevin

I have a directory in my local machine where I have all the plugins repositories from our company and then I have multiple WP setups (now using Valet) where I have the plugins symlinked. This way I can have the same plugin distributed across multiple setups and have different plugins also in different setups. Finally I can work only from a single directory in VS Code, maintaining all the plugins from one place. This also helps for debugging, because this way I only have one Xdebug configuration.

Hope that helps!

1 Like

Hi @alexmigf and anyone trying to do this. I’ve managed to get a workflow for getting Symlinks working. Please let me know if this is close enough to what you are needing and I’ll ask our developers if they can work it in as a feature in the future. I realize this won’t fit everyone’s needs but I feel like it’s a good start.

Important
Symlinks can only be created within the devkinsta_fpm container. You won’t be able to create a shortcut/symlink directly from your filesystem and have Docker recognize it with this solution.

image

So the idea is to create a directory like ~/DevKinsta/public/shared_plugins and add your plugin directory there. Then all you need to do is create a shortcut within ‘devkinsta_fpm’ that creates a Symlink to the plugin in “shared_plugins” from the appropriate site. Here is an example of a terminal command that does this with the Classic Widgets plugin that I needed to load from my site named “testing”:

docker exec devkinsta_fpm bash -c "ln -s /www/kinsta/public/shared_plugins/classic-widgets /www/kinsta/public/testing/wp-content/plugins/classic-widgets"

After Symlink:

Please let me know if this is a viable comprise/should be made more convenient.

Now if you have a plugin directory already set up and copying your plugins to the Kinsta directory would be too much trouble, our developers would need to modify DK/Docker to allow you to mount custom locations to devkinsta_fpm on startup. Here’s the documentation for that in case you want to play around with other possible solutions: Use bind mounts | Docker Documentation

1 Like

Hi Kevin, I’m in the exact same situation. When I run your command though, I see

ln: failed to create symbolic link ‘/Users/xyz/DevKinsta/public/abc/wp-content/plugins/rekindle-option-to-reset’: No such file or directory

How should I fix this?

Hi @rkg, so you only get that error if you are using the wrong directory/it doesn’t exist yet. Are you on Mac or Linux? If Linux, are you using Docker Desktop?

As a complete guess, it might be because you are trying to link to the system directory. My command is run within the Docker container so your directory/command should look more like this:

docker exec devkinsta_fpm bash -c "ln -s /www/kinsta/public/shared_plugins/rekindle-option-to-reset /www/kinsta/public/abc/wp-content/plugins/rekindle-option-to-reset"

Hi @Kevin I need to link from a system directory (where all my plugins are located) to a Docker container. Is there a way to modify your command to do that?

Thanks.

Hi @rkg, as I mentioned above my solution, this won’t work with linking a system directory to the Docker container. Right now, only the DevKinsta/user home directories are mounted to the Docker container and there is no straight forward way to mount a new system directory to the Docker container. I did discuss this with our developers and they will look into a solution that allows mounting custom system directories and takes care of all this Symlinking automatically.

So for now, your best bet is to just duplicate your system plugin directory to the already mounted DevKinsta directory then follow my solution.

Also, I found this software that might make this even easier: https://freefilesync.org/
The idea would be to continue working with your system plugin directory when developing but also have you changes/saves sync to your DevKinsta directory/copy. I haven’t tried it yet but it’s just another possibility if you’re trying to make this workaround more smooth.

Thank you @Kevin . I’ve been trying to get DevKinsta to work for a couple of years. I’ve always had some trouble getting it to work on my Mac. It’s finally working, and I now see how much easier it is to be working locally than having to FTP files back and forth. I appreciate the work you (personally) are doing on this forum!

1 Like

Very excited to hear that the DevKinsta devs are aware of the issue.

My use case for symlinks is I store cloned git repositories on my Mac in /Users/jamesgreenblue/repo/plugin-repo-name and would love to symlink /Users/jamesgreenblue/DevKinsta/public/greenfins/wp-content/plugins/plugin-repo-name to the original repo folder so that I don’t have to navigate deep into the filesystem to use git.

Echoing rkg – huge thank you for the work you are doing @Kevin !

1 Like

@Kevin

Am I misunderstanding that you’d need to have all of your plugins in one shared folder in order for this to work?

I have a shared folder for all my repos but they aren’t all plugins.

Hi @jmele, so if it’s convenient for you, you could move your repo directory to your DevKinsta public directory since that gets mounted within devkinsta_fpm. You would then be able to use symlinks within the Docker container to anything within your shared folder; it isn’t just limited to plugins. DevKinsta only cares about the site folders within ~/DevKinsta/public.

So it’s less about all of your plugins being in a shared folder, and more about your plugins existing within the mounted ~/DevKinsta/public directory.

If moving your repo folder isn’t an option, currently the only workaround would be to create a copy of your repo directory to ~/DevKinsta/public and then just make sure the files remain synced with something like https://freefilesync.org/ . You could then use symlinks within Docker.

Hmm ok. I currently use Local but wanted to test out DevKinsta with a similar setup as I have now but I don’t really want to move anything to avoid breakage then with my Local setup in case it doesn’t work out. Not loving the idea of having two copies but I’ll think about it. Thanks for the info, Kevin and I appreciate you trying to solve this problem for devs.

1 Like

Hi @Kevin

We are getting there, I think your solution indeed works, but as other user mention, I don’t want to move my current local folder to another place to not break the current setup.

If you could implement this idea using local folders I will move for your software for sure.

Thank you for all the hard work so far.

1 Like

Is there any update on this?

Hi @jmele,

this is something our devs are interested in but as of right now, we don’t have a feature that would allow this. Currently, the only option is the workaround shared above :point_up_2:

Regards,
Alessandro